summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2004-08-23 02:24:41 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2004-08-23 02:24:41 +0200
commite63a83e02bc310fadedf420061be7d713ee3a320 (patch)
tree8f48fa0d6b923f946da5144723b2d66f52d9ac48
parenta23a4605c2ad54359f7ea4068e79a54ef3cf3620 (diff)
kbuild/all archs: Utilise the cc-* functions
Searched through all architectures and utilised the cc-* functions when appropriate. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--arch/alpha/Makefile14
-rw-r--r--arch/arm/Makefile8
-rw-r--r--arch/ia64/Makefile10
-rw-r--r--arch/mips/Makefile6
-rw-r--r--arch/ppc/Makefile4
-rw-r--r--arch/ppc64/Makefile8
-rw-r--r--arch/s390/Makefile8
-rw-r--r--arch/sh/Makefile2
-rw-r--r--arch/sparc64/Makefile4
-rw-r--r--arch/x86_64/Makefile8
10 files changed, 31 insertions, 41 deletions
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index f63d72e08d97..2702912059ed 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -22,15 +22,11 @@ $(error The assembler '$(AS)' does not support the BWX instruction)
endif
# Determine if GCC understands the -mcpu= option.
-have_mcpu := $(shell if $(CC) -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
-
-have_mcpu_pca56 := $(shell if $(CC) -mcpu=pca56 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
-
-have_mcpu_ev6 := $(shell if $(CC) -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
-
-have_mcpu_ev67 := $(shell if $(CC) -mcpu=ev67 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
-
-have_msmall_data := $(shell if $(CC) -msmall-data -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
+have_mcpu := $(call cc-option-yn, -mcpu=ev5)
+have_mcpu_pca56 := $(call cc-option-yn, -mcpu=pca56)
+have_mcpu_ev6 := $(call cc-option-yn, -mcpu=ev6)
+have_mcpu_ev67 := $(call cc-option-yn, -mcpu=ev67)
+have_msmall_data := $(call cc-option-yn, -msmall-data)
cflags-$(have_msmall_data) += -msmall-data
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 9a3aab7b84c2..35d8a8c3d225 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -36,8 +36,8 @@ comma = ,
# Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes
# testing for a specific architecture or later rather impossible.
-arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call check_gcc,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
-arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call check_gcc,-march=armv5te,-march=armv4)
+arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
+arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4)
arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4
arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3
@@ -51,11 +51,11 @@ tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
-tune-$(CONFIG_CPU_XSCALE) :=$(call check_gcc,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
+tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
tune-$(CONFIG_CPU_V6) :=-mtune=strongarm
# Need -Uarm for gcc < 3.x
-CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm
+CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call cc-option,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm
AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu
CHECKFLAGS += -D__arm__=1
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index f2ca1e231388..955489b17307 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -23,9 +23,7 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
-falign-functions=32 -frename-registers
CFLAGS_KERNEL := -mconstant-gp
-GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
-GCC_MINOR_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f2 -d'.')
-
+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,16 +35,14 @@ $(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
-ifeq ($(GCC_VERSION),2)
+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),3)
- ifeq ($(GCC_MINOR_VERSION),4)
+ifeq ($(GCC_VERSION),0304)
# Workaround Itanium 1 bugs in gcc 3.4.
# cflags-$(CONFIG_ITANIUM) += -mtune=merced
cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley
- endif
endif
cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC) += -mb-step
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 5e22c90c55cf..5025c01b93ed 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -56,14 +56,12 @@ endif
#
cflags-y := -I $(TOPDIR)/include/asm/gcc
cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
-cflags-y += $(call check_gcc, -finline-limit=100000,)
+cflags-y += $(call cc-option, -finline-limit=100000)
LDFLAGS_vmlinux += -G 0 -static -n
MODFLAGS += -mlong-calls
cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer
-check_warning = $(shell if $(CC) $(1) -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
-
#
# Use: $(call set_gccflags,<cpu0>,<isa0>,<cpu1>,<isa1>,<isa2>)
#
@@ -162,7 +160,7 @@ cflags-$(CONFIG_CPU_R5432) += \
cflags-$(CONFIG_CPU_NEVADA) += \
$(call set_gccflags,rm5200,mips4,r5000,mips4,mips2) \
-Wa,--trap
-# $(call check_gcc,-mmad,)
+# $(call cc-option,-mmad)
cflags-$(CONFIG_CPU_RM7000) += \
$(call set_gccflags,rm7000,mips4,r5000,mips4,mips2) \
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 92307d7dcf20..df7b607b4d88 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -13,7 +13,7 @@
# This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD := $(CONFIG_KERNEL_START)
-HAS_BIARCH := $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+HAS_BIARCH := $(call cc-option-yn, -m32)
ifeq ($(HAS_BIARCH),y)
AS := $(AS) -a32
LD := $(LD) -m elf32ppc
@@ -112,7 +112,7 @@ else
NEW_AS := 0
endif
# gcc-3.4 and binutils-2.14 are a fatal combination.
-GCC_VERSION := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
+GCC_VERSION := $(call cc-version)
BAD_GCC_AS := $(shell echo mftb 5 | $(AS) -mppc -many -o /dev/null >/dev/null 2>&1 && echo 0 || echo 1)
checkbin:
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index 9b58c6644ff1..dd858fe61603 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -15,7 +15,7 @@
KERNELLOAD := 0xc000000000000000
-HAS_BIARCH := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+HAS_BIARCH := $(call cc-option-yn, -m64)
ifeq ($(HAS_BIARCH),y)
AS := $(AS) -a64
LD := $(LD) -m elf64ppc
@@ -30,14 +30,14 @@ CFLAGS += -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
-mtraceback=none
ifeq ($(CONFIG_POWER4_ONLY),y)
- CFLAGS += $(call check_gcc,-mcpu=power4,)
+ CFLAGS += $(call cc-option,-mcpu=power4)
else
- CFLAGS += $(call check_gcc,-mtune=power4,)
+ CFLAGS += $(call cc-option,-mtune=power4)
endif
# Enable unit-at-a-time mode when possible. It shrinks the
# kernel considerably.
-CFLAGS += $(call check_gcc,-funit-at-a-time,)
+CFLAGS += $(call cc-option,-funit-at-a-time)
head-y := arch/ppc64/kernel/head.o
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 68c1a72b0d92..904465485a92 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -28,12 +28,12 @@ AFLAGS += -m64
UTS_MACHINE := s390x
endif
-cflags-$(CONFIG_MARCH_G5) += $(call check_gcc,-march=g5,)
-cflags-$(CONFIG_MARCH_Z900) += $(call check_gcc,-march=z900,)
-cflags-$(CONFIG_MARCH_Z990) += $(call check_gcc,-march=z990,)
+cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
+cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
+cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
CFLAGS += $(cflags-y)
-CFLAGS += $(call check_gcc,-finline-limit=10000,)
+CFLAGS += $(call cc-option,-finline-limit=10000)
CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
CFLAGS += -mbackchain
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index e2f0221884ce..5d2c028d9efc 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -31,7 +31,7 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
cflags-$(CONFIG_CPU_SH2) += -m2
cflags-$(CONFIG_CPU_SH3) += -m3
cflags-$(CONFIG_CPU_SH4) += -m4 \
- $(call check_gcc,-mno-implicit-fp,-m4-nofpu)
+ $(call cc-option,-mno-implicit-fp,-m4-nofpu)
cflags-$(CONFIG_SH_DSP) += -Wa,-dsp
cflags-$(CONFIG_SH_KGDB) += -g
diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile
index 49c59a1ad3a4..789eeaf34c2f 100644
--- a/arch/sparc64/Makefile
+++ b/arch/sparc64/Makefile
@@ -14,10 +14,10 @@ CPPFLAGS_vmlinux.lds += -Usparc
CC := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo $(CC); else echo sparc64-linux-gcc; fi )
-NEW_GCC := $(shell if $(CC) -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; )
+NEW_GCC := $(call cc-option-yn, -m64 -mcmodel=medlow)
NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi)
UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; )
-INLINE_LIMIT := $(shell if $(CC) -m64 -finline-limit=100000 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; )
+INLINE_LIMIT := $(call cc-option-yn, -m64 -finline-limit=100000)
export NEW_GCC
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 3e685634e0d3..34aa2cebf16c 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -39,8 +39,8 @@ LDFLAGS_vmlinux := -e stext
CHECKFLAGS += -D__x86_64__=1
-cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,)
-cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=nocona,)
+cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
+cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
CFLAGS += $(cflags-y)
CFLAGS += -mno-red-zone
@@ -54,11 +54,11 @@ ifneq ($(CONFIG_DEBUG_INFO),y)
CFLAGS += -fno-asynchronous-unwind-tables
# -fweb shrinks the kernel a bit, but the difference is very small
# it also messes up debugging, so don't use it for now.
-#CFLAGS += $(call check_gcc,-fweb,)
+#CFLAGS += $(call cc-option,-fweb)
endif
# -funit-at-a-time shrinks the kernel .text considerably
# unfortunately it makes reading oopses harder.
-CFLAGS += $(call check_gcc,-funit-at-a-time,)
+CFLAGS += $(call cc-option,-funit-at-a-time)
head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o