]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commit
ARM: pass -marm to gcc by default for both C and assembler
authorArnd Bergmann <arnd@arndb.de>
Fri, 10 Aug 2012 11:12:20 +0000 (11:12 +0000)
committerArnd Bergmann <arnd@arndb.de>
Tue, 9 Oct 2012 18:29:05 +0000 (20:29 +0200)
commit91802a8ef410810db58907d2ea4c4adc00ef4688
tree778be8d346a007457f430b113f10467e66591a64
parentf880b67dcbdedb49453f88d2ccb1a0937b046d82
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>
arch/arm/Makefile