diff options
author | Douglas Anderson <dianders@chromium.org> | 2013-06-26 23:32:06 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-06-29 06:20:23 -0400 |
commit | 1b21376a737aeaa82320ae014b8e1c2c53cfc479 (patch) | |
tree | a4bc728855165356ac53f904e9974510d438ada9 /arch/arm/Makefile | |
parent | 81793bab5d7cc0d0962dae47dab3a63ae4bd5265 (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/Makefile | 56 |
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. |
62 | arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) | 62 | arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) |
63 | arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) | 63 | arch-$(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 |
66 | ifeq ($(CONFIG_CPU_32v6),y) | 66 | ifeq ($(CONFIG_CPU_32v6),y) |
67 | arch-$(CONFIG_CPU_32v6K) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) | 67 | arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) |
68 | endif | 68 | endif |
69 | arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t) | 69 | arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t) |
70 | arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t | 70 | arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t |
71 | arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 | 71 | arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4 |
72 | arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 | 72 | arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3 |
73 | |||
74 | # Evaluate arch cc-option calls now | ||
75 | arch-y := $(arch-y) | ||
73 | 76 | ||
74 | # This selects how we optimise for the processor. | 77 | # This selects how we optimise for the processor. |
75 | tune-$(CONFIG_CPU_ARM7TDMI) :=-mtune=arm7tdmi | 78 | tune-$(CONFIG_CPU_ARM7TDMI) =-mtune=arm7tdmi |
76 | tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi | 79 | tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi |
77 | tune-$(CONFIG_CPU_ARM740T) :=-mtune=arm7tdmi | 80 | tune-$(CONFIG_CPU_ARM740T) =-mtune=arm7tdmi |
78 | tune-$(CONFIG_CPU_ARM9TDMI) :=-mtune=arm9tdmi | 81 | tune-$(CONFIG_CPU_ARM9TDMI) =-mtune=arm9tdmi |
79 | tune-$(CONFIG_CPU_ARM940T) :=-mtune=arm9tdmi | 82 | tune-$(CONFIG_CPU_ARM940T) =-mtune=arm9tdmi |
80 | tune-$(CONFIG_CPU_ARM946E) :=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi) | 83 | tune-$(CONFIG_CPU_ARM946E) =$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi) |
81 | tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi | 84 | tune-$(CONFIG_CPU_ARM920T) =-mtune=arm9tdmi |
82 | tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi | 85 | tune-$(CONFIG_CPU_ARM922T) =-mtune=arm9tdmi |
83 | tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi | 86 | tune-$(CONFIG_CPU_ARM925T) =-mtune=arm9tdmi |
84 | tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi | 87 | tune-$(CONFIG_CPU_ARM926T) =-mtune=arm9tdmi |
85 | tune-$(CONFIG_CPU_FA526) :=-mtune=arm9tdmi | 88 | tune-$(CONFIG_CPU_FA526) =-mtune=arm9tdmi |
86 | tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 | 89 | tune-$(CONFIG_CPU_SA110) =-mtune=strongarm110 |
87 | tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 | 90 | tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100 |
88 | tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale | 91 | tune-$(CONFIG_CPU_XSCALE) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale |
89 | tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale | 92 | tune-$(CONFIG_CPU_XSC3) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale |
90 | tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale) | 93 | tune-$(CONFIG_CPU_FEROCEON) =$(call cc-option,-mtune=marvell-f,-mtune=xscale) |
91 | tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) | 94 | tune-$(CONFIG_CPU_V6) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) |
92 | tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) | 95 | tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) |
96 | |||
97 | # Evaluate tune cc-option calls now | ||
98 | tune-y := $(tune-y) | ||
93 | 99 | ||
94 | ifeq ($(CONFIG_AEABI),y) | 100 | ifeq ($(CONFIG_AEABI),y) |
95 | CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork | 101 | CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork |