From patchwork Fri Aug 10 11:12:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1304941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id E562FDF215 for ; Fri, 10 Aug 2012 11:15:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Szn8t-0000Pl-Dd; Fri, 10 Aug 2012 11:12:35 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Szn8p-0000PX-NB for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2012 11:12:32 +0000 Received: from klappe2.localnet (HSI-KBW-149-172-5-253.hsi13.kabel-badenwuerttemberg.de [149.172.5.253]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M4BD1-1TrD4X0J63-00rpb6; Fri, 10 Aug 2012 13:12:22 +0200 From: Arnd Bergmann To: Dave Martin Subject: Re: [PATCH 04/10] ARM: pass -marm to gcc by default Date: Fri, 10 Aug 2012 11:12:20 +0000 User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; ) References: <1344461278-28245-1-git-send-email-arnd@arndb.de> <20120810095911.GA2157@linaro.org> In-Reply-To: <20120810095911.GA2157@linaro.org> MIME-Version: 1.0 Message-Id: <201208101112.20416.arnd@arndb.de> X-Provags-ID: V02:K0:u+HQTzQVHKiRcNq4nDuf3WGxTxodfTMw44PpGiDJg78 b0rcK28glk0I3slK5+CrLxhWWit8N0fb0ofYaLgrRm7/cUvEq7 fJijcTa3hUWAtqqrKYVADNUWl+FbLeY+ARnFCPPwYyn40cs4Su orDVtP8zTHBKom3BiFv5NFozQbse+BoLsTOPKn0myEYrLNXe6i yOg1VtsA+BoRi5Reg5U07ClmBpCe0sMyCKR834GVe22MSsJ+wa qjKz4XAUkl59GpfoaoCe+xhvpUcZX7Oj1O6n01ssRRclsYlaFc yEynM3weoRGAMXRdlr2mkq953adFytJafhhHX9/WXD+rqzM9or xOjTFH3cCZ9aY6kM2plw= X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Nicolas Pitre , arm@kernel.org, Russell King - ARM Linux , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 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 Cc: Russell King Cc: Dave Martin 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__