From: Sam Ravnborg <sam@ravnborg.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 07/11] kbuild: remove GCC_VERSION
Date: Mon, 9 Jan 2006 22:38:34 +0100 [thread overview]
Message-ID: <11368427143913@foobar.com> (raw)
In-Reply-To: <20060109211157.GA14477@mars.ravnborg.org>
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 | 4 ++--
arch/i386/Makefile | 4 ++--
arch/ia64/Makefile | 7 +------
arch/powerpc/Makefile | 6 ++----
arch/ppc/Makefile | 3 +--
5 files changed, 8 insertions(+), 16 deletions(-)
ad14336de8e9cddae9ed29d45bd2e97abb72eaf9
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index d802ce8..443230b 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -1033,9 +1033,9 @@ When kbuild executes the following steps
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.
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index d121ea1..8f6b90e 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -39,8 +39,8 @@ include $(srctree)/arch/i386/Makefile.cp
# -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.
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 67932ad..f722e1a 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -25,7 +25,6 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -
-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
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
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index a13eb57..b98f11b 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -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.'; \
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index e719a49..98e940b 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -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.'; \
--
1.0.GIT
next prev parent reply other threads:[~2006-01-09 21:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-09 21:11 [GIT PATCHES] kbuild updates Sam Ravnborg
2006-01-09 21:38 ` [PATCH 01/11] kconfig: factor out ncurses check in a shell script Sam Ravnborg
2006-01-10 20:27 ` Jan Engelhardt
2006-01-10 21:01 ` Sam Ravnborg
2006-01-10 21:28 ` Jan Engelhardt
2006-01-11 16:55 ` Sam Ravnborg
2006-01-11 18:11 ` Jan Engelhardt
2006-01-09 21:38 ` [PATCH 02/11] kbuild: clean up asm-offsets.h creation Sam Ravnborg
2006-01-09 21:38 ` [PATCH 03/11] modpost/file2alias: Fix typo Sam Ravnborg
2006-01-09 21:38 ` [PATCH 04/11] kbuild: In setlocalversion change -git_dirty to just -dirty Sam Ravnborg
2006-01-09 21:38 ` [PATCH 05/11] kbuild: ensure mrproper removes .old_version Sam Ravnborg
2006-01-09 21:38 ` [PATCH 06/11] kbuild: reference_discarded addition Sam Ravnborg
2006-01-09 21:38 ` Sam Ravnborg [this message]
2006-01-09 21:38 ` [PATCH 08/11] frv: Use KERNELRELEASE Sam Ravnborg
2006-01-09 21:38 ` [PATCH 09/11] kbuild: drop vmlinux dependency from "make install" Sam Ravnborg
2006-01-12 16:21 ` Cal Peake
2006-01-12 21:25 ` Sam Ravnborg
2006-01-31 20:11 ` Dave Hansen
2006-01-31 21:04 ` [PATCH 09/11] kbuild: drop vmlinux dependency from 'make install' Sam Ravnborg
2006-02-01 23:27 ` Keith Owens
2006-01-09 21:38 ` [PATCH 10/11] kbuild/xfs: introduce fs/xfs/Kbuild Sam Ravnborg
2006-01-09 21:38 ` [PATCH 11/11] kbuild: KERNELRELEASE is only re-defined when buiding the kernel Sam Ravnborg
2006-01-09 21:50 ` [PATCH 12/11] kbuild: re-export VERSION, PATCHLEVEL, SUBLEVEL Sam Ravnborg
2006-01-10 16:27 ` [GIT PATCHES] kbuild updates Linus Torvalds
2006-01-12 23:18 ` [2.6 patch] i386: remove gcc version check for CONFIG_REGPARM Adrian Bunk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11368427143913@foobar.com \
--to=sam@ravnborg.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome