]> git.neil.brown.name Git - history.git/commitdiff
[ARM] Automatically select compiler options for ARMv5/Xscale CPUs.
authorRussell King <rmk@flint.arm.linux.org.uk>
Mon, 4 Aug 2003 01:03:41 +0000 (02:03 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Mon, 4 Aug 2003 01:03:41 +0000 (02:03 +0100)
arch/arm/Makefile

index a67c83382571f1335c4bdf3737b9e60dccfaccc6..0324926baddeacd71e082445de6609488ba3a9be 100644 (file)
@@ -30,6 +30,9 @@ AS            += -EB
 LD             += -EB
 endif
 
+check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
+comma = ,
+
 # Select CPU dependent flags.  Note that order of declaration is important;
 # the options further down the list override previous items.
 #
@@ -40,7 +43,7 @@ apcs-$(CONFIG_CPU_26)         :=-mapcs-26 -mcpu=arm3
 # 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_32v5)                :=-D__LINUX_ARM_ARCH__=5 -march=armv5te
+arch-$(CONFIG_CPU_32v5)                :=-D__LINUX_ARM_ARCH__=5 $(call check_gcc,-march=armv5te,-march=armv4 -Wa$(comma)-mxscale)
 arch-$(CONFIG_CPU_32v4)                :=-D__LINUX_ARM_ARCH__=4 -march=armv4
 arch-$(CONFIG_CPU_32v3)                :=-D__LINUX_ARM_ARCH__=3 -march=armv3
 
@@ -53,7 +56,7 @@ tune-$(CONFIG_CPU_ARM922T)    :=-mtune=arm9tdmi
 tune-$(CONFIG_CPU_ARM926T)     :=-mtune=arm9tdmi
 tune-$(CONFIG_CPU_SA110)       :=-mtune=strongarm110
 tune-$(CONFIG_CPU_SA1100)      :=-mtune=strongarm1100
-tune-$(CONFIG_CPU_XSCALE)      :=-mtune=xscale
+tune-$(CONFIG_CPU_XSCALE)      :=$(call check_gcc,-mtune=xscale,-mtune=strongarm110)
 
 # Force -mno-fpu to be passed to the assembler.  Some versions of gcc don't
 # do this with -msoft-float