[tip:core/header-fixes] compiler-gcc4: conditionalize #error on __KERNEL__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  8cd2c29dd5f04d91dac6ea7f8b9df4ff1b4380ee
Gitweb:     http://git.kernel.org/tip/8cd2c29dd5f04d91dac6ea7f8b9df4ff1b4380ee
Author:     H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
AuthorDate: Wed, 25 Feb 2009 15:22:19 -0800
Committer:  Ingo Molnar <mingo@xxxxxxx>
CommitDate: Thu, 26 Mar 2009 18:14:23 +0100

compiler-gcc4: conditionalize #error on __KERNEL__

Impact: Fix for exported headers

We only want to error out on specific gcc versions if we are actually
building the kernel, so conditionalize the #if...#error on __KERNEL__.

Based on a patchset by Arnd Bergmann <arnd@xxxxxxxx>.

Cc: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 include/linux/compiler-gcc4.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 0999271..450fa59 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -3,8 +3,10 @@
 #endif
 
 /* GCC 4.1.[01] miscompiles __weak */
-#if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
-# error Your version of gcc miscompiles the __weak directive
+#ifdef __KERNEL__
+# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
+#  error Your version of gcc miscompiles the __weak directive
+# endif
 #endif
 
 #define __used			__attribute__((__used__))
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux