aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/Makefile
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2013-06-26 23:32:06 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-06-29 06:20:23 -0400
commit1b21376a737aeaa82320ae014b8e1c2c53cfc479 (patch)
treea4bc728855165356ac53f904e9974510d438ada9 /arch/arm/Makefile
parent81793bab5d7cc0d0962dae47dab3a63ae4bd5265 (diff)
ARM: 7777/1: Avoid extra calls to the C compiler
Starting up the C compiler can be a slow operation on some systems. Though these calls don't individually take a lot of time, they add up. Rearrange the ARM Makefile a bit to avoid extra calls to the compiler when they can be easily avoided. When running with the Chrome OS ARM cross compiler "armv7a-cros-linux-gnueabi-", this shaved .55 seconds (from 5.31 seconds to 4.76 seconds) off an incremental build of the kernel: time make -j32 ARCH=arm CROSS_COMPILE=armv7a-cros-linux-gnueabi- Thanks to Mike Frysinger for the clean trick to make this work. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/Makefile')
-rw-r--r--arch/arm/Makefile56
1 files changed, 31 insertions, 25 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 10c08092378f..20559a089442 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -59,37 +59,43 @@ comma = ,
59# Note that GCC does not numerically define an architecture version 59# Note that GCC does not numerically define an architecture version
60# macro, but instead defines a whole series of macros which makes 60# macro, but instead defines a whole series of macros which makes
61# testing for a specific architecture or later rather impossible. 61# testing for a specific architecture or later rather impossible.
62arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) 62arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
63arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) 63arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
64# Only override the compiler option if ARMv6. The ARMv6K extensions are 64# Only override the compiler option if ARMv6. The ARMv6K extensions are
65# always available in ARMv7 65# always available in ARMv7
66ifeq ($(CONFIG_CPU_32v6),y) 66ifeq ($(CONFIG_CPU_32v6),y)
67arch-$(CONFIG_CPU_32v6K) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) 67arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
68endif 68endif
69arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t) 69arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
70arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t 70arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t
71arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 71arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4
72arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 72arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3
73
74# Evaluate arch cc-option calls now
75arch-y := $(arch-y)
73 76
74# This selects how we optimise for the processor. 77# This selects how we optimise for the processor.
75tune-$(CONFIG_CPU_ARM7TDMI) :=-mtune=arm7tdmi 78tune-$(CONFIG_CPU_ARM7TDMI) =-mtune=arm7tdmi
76tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi 79tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
77tune-$(CONFIG_CPU_ARM740T) :=-mtune=arm7tdmi 80tune-$(CONFIG_CPU_ARM740T) =-mtune=arm7tdmi
78tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9tdmi 81tune-$(CONFIG_CPU_ARM9TDMI) =-mtune=arm9tdmi
79tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9tdmi 82tune-$(CONFIG_CPU_ARM940T) =-mtune=arm9tdmi
80tune-$(CONFIG_CPU_ARM946E) :=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi) 83tune-$(CONFIG_CPU_ARM946E) =$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi)
81tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi 84tune-$(CONFIG_CPU_ARM920T) =-mtune=arm9tdmi
82tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi 85tune-$(CONFIG_CPU_ARM922T) =-mtune=arm9tdmi
83tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi 86tune-$(CONFIG_CPU_ARM925T) =-mtune=arm9tdmi
84tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi 87tune-$(CONFIG_CPU_ARM926T) =-mtune=arm9tdmi
85tune-$(CONFIG_CPU_FA526) :=-mtune=arm9tdmi 88tune-$(CONFIG_CPU_FA526) =-mtune=arm9tdmi
86tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 89tune-$(CONFIG_CPU_SA110) =-mtune=strongarm110
87tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 90tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
88tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale 91tune-$(CONFIG_CPU_XSCALE) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
89tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale 92tune-$(CONFIG_CPU_XSC3) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
90tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale) 93tune-$(CONFIG_CPU_FEROCEON) =$(call cc-option,-mtune=marvell-f,-mtune=xscale)
91tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 94tune-$(CONFIG_CPU_V6) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
92tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 95tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
96
97# Evaluate tune cc-option calls now
98tune-y := $(tune-y)
93 99
94ifeq ($(CONFIG_AEABI),y) 100ifeq ($(CONFIG_AEABI),y)
95CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork 101CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork