diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-08-10 07:12:20 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-10-09 14:29:05 -0400 |
commit | 91802a8ef410810db58907d2ea4c4adc00ef4688 (patch) | |
tree | 778be8d346a007457f430b113f10467e66591a64 /arch/arm/Makefile | |
parent | f880b67dcbdedb49453f88d2ccb1a0937b046d82 (diff) |
ARM: pass -marm to gcc by default for both C and assembler
The Linaro cross toolchain and probably others nowadays default to
building in THUMB2 mode. When building a kernel for a CPU that does
not support THUMB2, the compiler complains about incorrect flags.
We can work around this by setting -marm for all non-T2 builds.
-marm was passed unconditionally for C files previously, but nothing was
passed to the gcc frontend when processing .S files, resulting in a
warning. The assembler never defaults to ARM unless -Wa,-mthumb is
supplied explicitly, so the files were still assembled correctly.
This patch makes sure that -marm is passed for .S files too, and also
avoids the redundant gcc -marm -mthumb in Thumb kernels.
Without this patch, building assabet_defconfig results in:
usr/initramfs_data.S:1:0: warning: target CPU does not support THUMB instructions [enabled by default]
arch/arm/nwfpe/entry.S:1:0: warning: target CPU does not support THUMB instructions [enabled by default]
firmware/cis/PCMLM28.cis.gen.S:1:0: warning: target CPU does not support THUMB instructions [enabled by default]
(and many more)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Dave Martin <dave.martin@linaro.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/Makefile')
-rw-r--r-- | arch/arm/Makefile | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f023e3acdfbd..5f914fca911b 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -21,8 +21,6 @@ endif | |||
21 | OBJCOPYFLAGS :=-O binary -R .comment -S | 21 | OBJCOPYFLAGS :=-O binary -R .comment -S |
22 | GZFLAGS :=-9 | 22 | GZFLAGS :=-9 |
23 | #KBUILD_CFLAGS +=-pipe | 23 | #KBUILD_CFLAGS +=-pipe |
24 | # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: | ||
25 | KBUILD_CFLAGS +=$(call cc-option,-marm,) | ||
26 | 24 | ||
27 | # Never generate .eh_frame | 25 | # Never generate .eh_frame |
28 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | 26 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) |
@@ -105,17 +103,20 @@ endif | |||
105 | ifeq ($(CONFIG_THUMB2_KERNEL),y) | 103 | ifeq ($(CONFIG_THUMB2_KERNEL),y) |
106 | AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it) | 104 | AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it) |
107 | AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) | 105 | AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) |
108 | CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN) | 106 | CFLAGS_ISA :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN) |
109 | AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb | 107 | AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb |
110 | # Work around buggy relocation from gas if requested: | 108 | # Work around buggy relocation from gas if requested: |
111 | ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y) | 109 | ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y) |
112 | CFLAGS_MODULE +=-fno-optimize-sibling-calls | 110 | CFLAGS_MODULE +=-fno-optimize-sibling-calls |
113 | endif | 111 | endif |
112 | else | ||
113 | CFLAGS_ISA :=$(call cc-option,-marm,) | ||
114 | AFLAGS_ISA :=$(CFLAGS_ISA) | ||
114 | endif | 115 | endif |
115 | 116 | ||
116 | # Need -Uarm for gcc < 3.x | 117 | # Need -Uarm for gcc < 3.x |
117 | KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_THUMB2) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm | 118 | KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm |
118 | KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_THUMB2) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float | 119 | KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float |
119 | 120 | ||
120 | CHECKFLAGS += -D__arm__ | 121 | CHECKFLAGS += -D__arm__ |
121 | 122 | ||