OSDN Git Service

Do not complain about gcc 4.2 for user-space
authorWilly Tarreau <w@1wt.eu>
Sun, 13 Jan 2008 11:14:07 +0000 (12:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 3 Feb 2008 15:35:55 +0000 (16:35 +0100)
Some user-space include compiler.h, so do not disable gcc 4.2
if __KERNEL__ is not defined.

Problem reported and fix confirmed by Gabor Z. Papp :
"
gcc -Wp,-MT,syslinux.o,-MMD,.syslinux.o.d -W -Wall -D_FILE_OFFSET_BITS=64 -g -Os -I. -I.. -I../libinstaller -c -o syslinux.o syslinux.c
In file included from /usr/include/asm/byteorder.h:5,
                 from /usr/include/linux/msdos_fs.h:11,
                 from syslinux.c:51:
/usr/include/linux/compiler.h:45:2: error: #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!"
/usr/include/linux/compiler.h:46:2: error: #error "While the resulting kernel may boot, you will encounter random bugs"
/usr/include/linux/compiler.h:47:2: error: #error "at runtime. Only versions 2.95.3 to 4.1 are known to work reliably."
/usr/include/linux/compiler.h:48:2: error: #error "To build with another version, for instance 3.3, please do"
/usr/include/linux/compiler.h:49:2: error: #error "   make bzImage CC=gcc-3.3 "
make[1]: *** [syslinux.o] Error 1

After patching compiler.h, compile was fine.
"

Signed-off-by: Willy Tarreau <w@1wt.eu>
include/linux/compiler.h

index 92a6a70..e2ddf28 100644 (file)
@@ -41,6 +41,7 @@
 #endif
 #endif
 
+#ifdef __KERNEL__
 #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"
@@ -48,6 +49,7 @@
 #error "To build with another version, for instance 3.3, please do"
 #error "   make bzImage CC=gcc-3.3 "
 #endif
+#endif
 
 /* no checker support, so we unconditionally define this as (null) */
 #define __user