summaryrefslogtreecommitdiffstats
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
authorMark Charlebois <charlebm@gmail.com>2012-11-20 22:13:10 +0100
committerBehan Webster <behanw@converseincode.com>2014-04-09 13:44:35 -0700
commit565cbdc2fec92ef2ae75995e06e69172ed2edecd (patch)
tree5f28a812a1ec430e87827cabd654b8429527bb36 /include/linux/compiler.h
parentaa93685afbefa0e31af3a0a03ff97b37ee92a90b (diff)
downloadop-kernel-dev-565cbdc2fec92ef2ae75995e06e69172ed2edecd.zip
op-kernel-dev-565cbdc2fec92ef2ae75995e06e69172ed2edecd.tar.gz
LLVMLinux: Add support for clang to compiler.h and new compiler-clang.h
Add a compiler-clang.h file to add specific macros needed for compiling the kernel with clang. Initially the only override required is the macro for silencing the compiler for a purposefully uninintialized variable. Author: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Behan Webster <behanw@converseincode.com>
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 2472740..ee7239e 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -63,6 +63,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
# include <linux/compiler-intel.h>
#endif
+/* Clang compiler defines __GNUC__. So we will overwrite implementations
+ * coming from above header files here
+ */
+#ifdef __clang__
+#include <linux/compiler-clang.h>
+#endif
+
/*
* Generic compiler-dependent macros required for kernel
* build go below this comment. Actual compiler/compiler version
OpenPOWER on IntegriCloud