All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] ARM: pass -marm to gcc by default
Date: Fri, 10 Aug 2012 11:12:20 +0000	[thread overview]
Message-ID: <201208101112.20416.arnd@arndb.de> (raw)
In-Reply-To: <20120810095911.GA2157@linaro.org>

On Friday 10 August 2012, Dave Martin wrote:
> On Thu, Aug 09, 2012 at 05:22:30PM -0400, Nicolas Pitre wrote:
> > On Thu, 9 Aug 2012, Russell King - ARM Linux wrote:
> > 
> > > On Thu, Aug 09, 2012 at 05:12:58PM -0400, Nicolas Pitre wrote:
> > > > CFLAGS_THUMB2 should probably be renamed to something more appropriate 
> > > > in this case, e.g. CFLAGS_MODE.
> > > 
> > > CFLAGS_ISA would be more relevant to it, because it's selecting the
> > > instruction set.
> > 
> > Agreed.  This particular TLA escaped my mind somehow.
> 
> Seems fair enough.  It doesn't quite match the official architectural
> terminology, but it clear enough what it means, and less cumbersome than
> the alternatives.
> 
> Best not to use MODE though.  That word is way too overloaded.

Ok. I already noticed that we already set -marm in KBUILD_CFLAGS but
not in the AFLAGS. This new version should cover all the issues
and make it more obvious what's actually going on.

	Arnd

8<----
>From 34763772164d1442509f27d7f8a09326ff4b7878 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 30 Apr 2012 12:40:00 +0000
Subject: [PATCH] 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.

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>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Dave Martin <dave.martin@linaro.org>

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 30eae87..ca0dabc 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -21,8 +21,6 @@ endif
 OBJCOPYFLAGS	:=-O binary -R .comment -S
 GZFLAGS		:=-9
 #KBUILD_CFLAGS	+=-pipe
-# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
-KBUILD_CFLAGS	+=$(call cc-option,-marm,)
 
 # Never generate .eh_frame
 KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
@@ -105,17 +103,20 @@ endif
 ifeq ($(CONFIG_THUMB2_KERNEL),y)
 AFLAGS_AUTOIT	:=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
 AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
-CFLAGS_THUMB2	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
-AFLAGS_THUMB2	:=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
+CFLAGS_ISA	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
+AFLAGS_ISA	:=$(CFLAGS_ISA) -Wa$(comma)-mthumb
 # Work around buggy relocation from gas if requested:
 ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
 CFLAGS_MODULE	+=-fno-optimize-sibling-calls
 endif
+else
+CFLAGS_ISA	:=$(call cc-option,-marm,)
+AFLAGS_ISA	:=$(CFLAGS_ISA)
 endif
 
 # Need -Uarm for gcc < 3.x
-KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_THUMB2) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
-KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_THUMB2) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
+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
 
 CHECKFLAGS	+= -D__arm__
 

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Dave Martin <dave.martin@linaro.org>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>,
	"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org, arm@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/10] ARM: pass -marm to gcc by default
Date: Fri, 10 Aug 2012 11:12:20 +0000	[thread overview]
Message-ID: <201208101112.20416.arnd@arndb.de> (raw)
In-Reply-To: <20120810095911.GA2157@linaro.org>

On Friday 10 August 2012, Dave Martin wrote:
> On Thu, Aug 09, 2012 at 05:22:30PM -0400, Nicolas Pitre wrote:
> > On Thu, 9 Aug 2012, Russell King - ARM Linux wrote:
> > 
> > > On Thu, Aug 09, 2012 at 05:12:58PM -0400, Nicolas Pitre wrote:
> > > > CFLAGS_THUMB2 should probably be renamed to something more appropriate 
> > > > in this case, e.g. CFLAGS_MODE.
> > > 
> > > CFLAGS_ISA would be more relevant to it, because it's selecting the
> > > instruction set.
> > 
> > Agreed.  This particular TLA escaped my mind somehow.
> 
> Seems fair enough.  It doesn't quite match the official architectural
> terminology, but it clear enough what it means, and less cumbersome than
> the alternatives.
> 
> Best not to use MODE though.  That word is way too overloaded.

Ok. I already noticed that we already set -marm in KBUILD_CFLAGS but
not in the AFLAGS. This new version should cover all the issues
and make it more obvious what's actually going on.

	Arnd

8<----
>From 34763772164d1442509f27d7f8a09326ff4b7878 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 30 Apr 2012 12:40:00 +0000
Subject: [PATCH] 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.

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>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Dave Martin <dave.martin@linaro.org>

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 30eae87..ca0dabc 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -21,8 +21,6 @@ endif
 OBJCOPYFLAGS	:=-O binary -R .comment -S
 GZFLAGS		:=-9
 #KBUILD_CFLAGS	+=-pipe
-# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
-KBUILD_CFLAGS	+=$(call cc-option,-marm,)
 
 # Never generate .eh_frame
 KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
@@ -105,17 +103,20 @@ endif
 ifeq ($(CONFIG_THUMB2_KERNEL),y)
 AFLAGS_AUTOIT	:=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
 AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
-CFLAGS_THUMB2	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
-AFLAGS_THUMB2	:=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
+CFLAGS_ISA	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
+AFLAGS_ISA	:=$(CFLAGS_ISA) -Wa$(comma)-mthumb
 # Work around buggy relocation from gas if requested:
 ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
 CFLAGS_MODULE	+=-fno-optimize-sibling-calls
 endif
+else
+CFLAGS_ISA	:=$(call cc-option,-marm,)
+AFLAGS_ISA	:=$(CFLAGS_ISA)
 endif
 
 # Need -Uarm for gcc < 3.x
-KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_THUMB2) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
-KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_THUMB2) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
+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
 
 CHECKFLAGS	+= -D__arm__
 

  reply	other threads:[~2012-08-10 11:12 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 21:27 [PATCH 00/10] ARM: interesting warnings from defconfig builds Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 01/10] ARM: footbridge: nw_gpio_lock is raw_spin_lock Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 02/10] ARM: ks8695: __arch_virt_to_dma type handling Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 03/10] ARM: mv78xx0: fix win_cfg_base prototype Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-13 14:59   ` Andrew Lunn
2012-08-13 14:59     ` Andrew Lunn
2012-08-08 21:27 ` [PATCH 04/10] ARM: pass -marm to gcc by default Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-09 21:12   ` Nicolas Pitre
2012-08-09 21:12     ` Nicolas Pitre
2012-08-09 21:17     ` Russell King - ARM Linux
2012-08-09 21:17       ` Russell King - ARM Linux
2012-08-09 21:22       ` Nicolas Pitre
2012-08-09 21:22         ` Nicolas Pitre
2012-08-10  9:59         ` Dave Martin
2012-08-10  9:59           ` Dave Martin
2012-08-10 11:12           ` Arnd Bergmann [this message]
2012-08-10 11:12             ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 05/10] asm-generic: xor: mark static functions as __maybe_unused Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 06/10] ARM: davinci: don't use broken ntosd2_init_i2c Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-09  8:00   ` [PATCH v2 " Arnd Bergmann
2012-08-09  8:00     ` Arnd Bergmann
2012-08-09 18:23     ` Sekhar Nori
2012-08-09 18:23       ` Sekhar Nori
2012-08-08 21:27 ` [PATCH 07/10] ARM: rpc: check device_register return code in ecard_probe Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 08/10] ARM: s3c24xx: enable CONFIG_BUG for tct_hammer Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-10  6:07   ` Kukjin Kim
2012-08-10  6:07     ` Kukjin Kim
2012-08-08 21:27 ` [PATCH 09/10] ARM: rpc: Fix building RiscPC Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-09  7:47   ` Russell King - ARM Linux
2012-08-09  7:47     ` Russell King - ARM Linux
2012-08-10 11:03     ` Arnd Bergmann
2012-08-10 11:03       ` Arnd Bergmann
2012-08-13 10:52       ` Russell King - ARM Linux
2012-08-13 10:52         ` Russell King - ARM Linux
2012-08-08 21:27 ` [PATCH 10/10] leds: renesas: fix error handling Arnd Bergmann
2012-08-08 21:27   ` Arnd Bergmann
2012-08-09  6:15   ` Bryan Wu
2012-08-09  6:15     ` Bryan Wu
2012-08-09  7:34     ` Arnd Bergmann
2012-08-09  7:34       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201208101112.20416.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.