aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-12 20:00:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-12 20:00:40 -0400
commit09c9b61d5da24174b867a6ffda29b7435e1fda74 (patch)
tree89f5775bfeb0305f3b87a97c488b7e8347294821 /include
parent141eaccd018ef0476e94b180026d973db35460fd (diff)
parentc4586256f0c440bc2bdb29d2cbb915f0ca785d26 (diff)
Merge tag 'llvmlinux-for-v3.15' of git://git.linuxfoundation.org/llvmlinux/kernel
Pull llvm patches from Behan Webster: "These are some initial updates to support compiling the kernel with clang. These patches have been through the proper reviews to the best of my ability, and have been soaking in linux-next for a few weeks. These patches by themselves still do not completely allow clang to be used with the kernel code, but lay the foundation for other patches which are still under review. Several other of the LLVMLinux patches have been already added via maintainer trees" * tag 'llvmlinux-for-v3.15' of git://git.linuxfoundation.org/llvmlinux/kernel: x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id" x86 kbuild: LLVMLinux: More cc-options added for clang x86, acpi: LLVMLinux: Remove nested functions from Thinkpad ACPI LLVMLinux: Add support for clang to compiler.h and new compiler-clang.h LLVMLinux: Remove warning about returning an uninitialized variable kbuild: LLVMLinux: Fix LINUX_COMPILER definition script for compilation with clang Documentation: LLVMLinux: Update Documentation/dontdiff kbuild: LLVMLinux: Adapt warnings for compilation with clang kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/cmpxchg-local.h3
-rw-r--r--include/linux/compiler-clang.h12
-rw-r--r--include/linux/compiler.h7
-rw-r--r--include/linux/mod_devicetable.h5
4 files changed, 26 insertions, 1 deletions
diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h
index d8d4c898c1bb..70bef78912b7 100644
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -4,7 +4,8 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/irqflags.h> 5#include <linux/irqflags.h>
6 6
7extern unsigned long wrong_size_cmpxchg(volatile void *ptr); 7extern unsigned long wrong_size_cmpxchg(volatile void *ptr)
8 __noreturn;
8 9
9/* 10/*
10 * Generic version of __cmpxchg_local (disables interrupts). Takes an unsigned 11 * Generic version of __cmpxchg_local (disables interrupts). Takes an unsigned
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
new file mode 100644
index 000000000000..d1e49d52b640
--- /dev/null
+++ b/include/linux/compiler-clang.h
@@ -0,0 +1,12 @@
1#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
3#endif
4
5/* Some compiler specific definitions are overwritten here
6 * for Clang compiler
7 */
8
9#ifdef uninitialized_var
10#undef uninitialized_var
11#define uninitialized_var(x) x = *(&(x))
12#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 2472740d7ab2..ee7239ea1583 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -63,6 +63,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
63# include <linux/compiler-intel.h> 63# include <linux/compiler-intel.h>
64#endif 64#endif
65 65
66/* Clang compiler defines __GNUC__. So we will overwrite implementations
67 * coming from above header files here
68 */
69#ifdef __clang__
70#include <linux/compiler-clang.h>
71#endif
72
66/* 73/*
67 * Generic compiler-dependent macros required for kernel 74 * Generic compiler-dependent macros required for kernel
68 * build go below this comment. Actual compiler/compiler version 75 * build go below this comment. Actual compiler/compiler version
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 9a165a213d93..44eeef0da186 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -556,6 +556,11 @@ struct amba_id {
556 * See documentation of "x86_match_cpu" for details. 556 * See documentation of "x86_match_cpu" for details.
557 */ 557 */
558 558
559/*
560 * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id.
561 * Although gcc seems to ignore this error, clang fails without this define.
562 */
563#define x86cpu_device_id x86_cpu_id
559struct x86_cpu_id { 564struct x86_cpu_id {
560 __u16 vendor; 565 __u16 vendor;
561 __u16 family; 566 __u16 family;