kbuild: remove GCC_VERSION
authorSam Ravnborg <sam@mars.ravnborg.org>
Sun, 8 Jan 2006 18:58:51 +0000 (19:58 +0100)
committerSam Ravnborg <sam@mars.ravnborg.org>
Sun, 8 Jan 2006 18:58:51 +0000 (19:58 +0100)
This was causing some ordering problems.  Remove the up-front evaluation
and just revaluate the compiler version each time we need it.

(The up-front evaluation was problematic because some architectures modify
the value of $(CC)).

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Documentation/kbuild/makefiles.txt
arch/i386/Makefile
arch/ia64/Makefile
arch/powerpc/Makefile
arch/ppc/Makefile

index d802ce8..443230b 100644 (file)
@@ -1033,9 +1033,9 @@ When kbuild executes the following steps are followed (roughly):
 
        Example:
                #arch/i386/Makefile
-               GCC_VERSION := $(call cc-version)
                cflags-y += $(shell \
-               if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
+               if [ $(call cc-version) -ge 0300 ] ; then \
+                       echo "-mregparm=3"; fi ;)
 
        In the above example -mregparm=3 is only used for gcc version greater
        than or equal to gcc 3.0.
index d121ea1..8f6b90e 100644 (file)
@@ -39,8 +39,8 @@ include $(srctree)/arch/i386/Makefile.cpu
 
 # -mregparm=3 works ok on gcc-3.0 and later
 #
-GCC_VERSION                    := $(call cc-version)
-cflags-$(CONFIG_REGPARM)       += $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
+cflags-$(CONFIG_REGPARM) += $(shell if [ $(call cc-version) -ge 0300 ] ; then \
+                            echo "-mregparm=3"; fi ;)
 
 # Disable unit-at-a-time mode, it makes gcc use a lot more stack
 # due to the lack of sharing of stacklots.
index 67932ad..f722e1a 100644 (file)
@@ -25,7 +25,6 @@ cflags-y      := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
                   -falign-functions=32 -frename-registers -fno-optimize-sibling-calls
 CFLAGS_KERNEL  := -mconstant-gp
 
-GCC_VERSION     := $(call cc-version)
 GAS_STATUS     = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")
 CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)")
 
@@ -37,11 +36,7 @@ $(error Sorry, you need a newer version of the assember, one that is built from
                ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
 endif
 
-ifneq ($(shell if [ $(GCC_VERSION) -lt 0300 ] ; then echo "bad"; fi ;),)
-$(error Sorry, your compiler is too old.  GCC v2.96 is known to generate bad code.)
-endif
-
-ifeq ($(GCC_VERSION),0304)
+ifeq ($(call cc-version),0304)
        cflags-$(CONFIG_ITANIUM)        += -mtune=merced
        cflags-$(CONFIG_MCKINLEY)       += -mtune=mckinley
 endif
index a13eb57..b98f11b 100644 (file)
@@ -76,8 +76,7 @@ LINUXINCLUDE    += $(LINUXINCLUDE-y)
 CHECKFLAGS     += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
 
 ifeq ($(CONFIG_PPC64),y)
-GCC_VERSION     := $(call cc-version)
-GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi)
+GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
 
 ifeq ($(CONFIG_POWER4_ONLY),y)
 ifeq ($(CONFIG_ALTIVEC),y)
@@ -189,10 +188,9 @@ TOUT       := .tmp_gas_check
 # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
 # instructions.
 # gcc-3.4 and binutils-2.14 are a fatal combination.
-GCC_VERSION    := $(call cc-version)
 
 checkbin:
-       @if test "$(GCC_VERSION)" = "0304" ; then \
+       @if test "$(call cc-version)" = "0304" ; then \
                if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
                        echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
                        echo 'correctly with gcc-3.4 and your version of binutils.'; \
index e719a49..98e940b 100644 (file)
@@ -128,10 +128,9 @@ TOUT       := .tmp_gas_check
 # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
 # instructions.
 # gcc-3.4 and binutils-2.14 are a fatal combination.
-GCC_VERSION    := $(call cc-version)
 
 checkbin:
-       @if test "$(GCC_VERSION)" = "0304" ; then \
+       @if test "$(call cc-version)" = "0304" ; then \
                if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
                        echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
                        echo 'correctly with gcc-3.4 and your version of binutils.'; \