OSDN Git Service

[PATCH] GCC >= 4.2 miscompiles the kernel
authorWilly Tarreau <w@1wt.eu>
Sun, 9 Dec 2007 16:26:13 +0000 (17:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 Dec 2007 16:26:13 +0000 (17:26 +0100)
Add a check for GCC >= 4.2 and refuse to use it. It miscompiles
kernel 2.4 in a very nasty way, and it's hard to identify faulty
modules.

include/linux/compiler.h

index ba73dbf..92a6a70 100644 (file)
 #endif
 #endif
 
+#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 2
+#error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!"
+#error "While the resulting kernel may boot, you will encounter random bugs"
+#error "at runtime. Only versions 2.95.3 to 4.1 are known to work reliably."
+#error "To build with another version, for instance 3.3, please do"
+#error "   make bzImage CC=gcc-3.3 "
+#endif
+
 /* no checker support, so we unconditionally define this as (null) */
 #define __user
 #define __iomem