OSDN Git Service

[PATCH] second build fix for some rare buggy versions of GCC 4
authorWilly Tarreau <w@1wt.eu>
Thu, 9 Aug 2007 21:07:01 +0000 (23:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 9 Aug 2007 21:07:53 +0000 (23:07 +0200)
Last gcc4 fix 78bf0892b4008a0011f7af916460bc59103acd0a uncoverred a known
bug which appeared in gcc between 4.1 and 4.2.0 and which makes it ignore
the first -fno-builtin-xxx when more than one of those params is passed.
This resulted in the kernel not building with some versions such as
gcc version 4.1.2 20061115 (prerelease) as shipped by Debian as version
4.1.1-21.

Since those versions do not need -fno-builtin-strpbrk, set this option
first so that it doesn't matter wether it's ignored. This fix was confirmed
by Richard Kojedzinszky. So with this fix, we know the kernel builds on x86
with gcc-4.1.1 (already did), 4.1.2-20061115, and 4.2.1.

Reference to the thread discussing this bug on gcc-ml :

  http://gcc.gnu.org/ml/gcc-bugs/2006-07/msg01514.html

Signed-off-by: Willy Tarreau <w@1wt.eu>
Makefile

index 71b6652..d3312be 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,7 @@ CPPFLAGS := -D__KERNEL__ -I$(HPATH)
 
 CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
          -fno-strict-aliasing -fno-common
-CFLAGS += -fno-builtin-sprintf -fno-builtin-strpbrk
+CFLAGS += -fno-builtin-strpbrk -fno-builtin-sprintf
 ifndef CONFIG_FRAME_POINTER
 CFLAGS += -fomit-frame-pointer
 endif