diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 12:29:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 12:29:43 -0500 |
commit | f9d14250071eda9972e4c9cea745a11185952114 (patch) | |
tree | a8839b522bf83b96a238bd6cb0e88093731a1e24 | |
parent | f153b82121b0366fe0e5f9553545cce237335175 (diff) |
Disallow gcc versions 4.1.{0,1}
These compiler versions are known to miscompile __weak functions and
thus generate kernels that don't necessarily work correctly. If a weak
function is int he same compilation unit as a caller, gcc may end up
inlining it, and thus binding the weak function too early.
See
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781
for details.
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/compiler-gcc4.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index aa426214331b..09992718f9e8 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -2,6 +2,11 @@ | |||
2 | #error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." | 2 | #error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | /* GCC 4.1.[01] miscompiles __weak */ | ||
6 | #if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 | ||
7 | # error Your version of gcc miscompiles the __weak directive | ||
8 | #endif | ||
9 | |||
5 | #define __used __attribute__((__used__)) | 10 | #define __used __attribute__((__used__)) |
6 | #define __must_check __attribute__((warn_unused_result)) | 11 | #define __must_check __attribute__((warn_unused_result)) |
7 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 12 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |