[PATCH RFC] ARM: use -marm unconditionally for THUMB2_KERNEL=n builds

Russell King - ARM Linux linux at arm.linux.org.uk
Wed May 27 10:46:57 PDT 2015

On Wed, May 27, 2015 at 04:59:21PM +0200, Uwe Kleine-König wrote:
> Hello Russell,
> On Wed, May 27, 2015 at 10:53:39AM +0100, Russell King - ARM Linux wrote:
> > On Wed, May 27, 2015 at 11:42:07AM +0200, Uwe Kleine-König wrote:
> > > The only possible culprit is a compiler that doesn't understand -marm.
> > > My compiler collection only goes back to 4.0.3 which does work with this
> > > option. The use of cc-option to test for -marm was introduced in commit
> > > 5636810d6f17 ([ARM] 3982/2: Explicitly select 32-bit ARM ISA (-marm))
> > > back in 2006 when the minimal compiler version was already 3.3.
> > 
> > According to gcc 3.3's --target-help, it supports -mthumb, but not -marm.
> > 
> > What we could possibly do is to change the := to a plain =, and then
> > evaluate all the options together via:
> > 
> You mean
> 	KBUILD_CFLAGS += $(arch-y)
> as soon as arch-y is defined to assert it's already present when -marm
> is tested for, right? I will give that a try.

I mean:

-CFLAGS_ISA	:=$(call cc-option,-marm,)
+CFLAGS_ISA	=$(call cc-option,-marm,)
-KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
-KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
+CFLAGS_TRAPS	:=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
+KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(CFLAGS_TRAPS) -msoft-float -Uarm
+KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float

+# Ensures that all previous $(call ...) options are evaluated once

This has the effect that "-marm" will be evaluated with all the other
KBUILD_CFLAGS options already set.  (I think I have this right...)

FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

More information about the linux-arm-kernel mailing list