Skip to content

Commit

Permalink
compiler-gcc4: conditionalize #error on __KERNEL__
Browse files Browse the repository at this point in the history
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@arndb.de>.

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
H. Peter Anvin authored and Ingo Molnar committed Mar 26, 2009
1 parent 3a471cb commit 8cd2c29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/linux/compiler-gcc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand Down

0 comments on commit 8cd2c29

Please sign in to comment.