From patchwork Fri Oct 5 14:55:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12016 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0433123EF8 for ; Fri, 5 Oct 2012 14:56:17 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8FCC2A1909A for ; Fri, 5 Oct 2012 14:56:16 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3893275iej.11 for ; Fri, 05 Oct 2012 07:56:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=OOwQIUW05TRiNFz/D1qqRw7wCRmhP5EAtTpBtd96/Co=; b=BLs+TWJmR//4KcOBqdmG3jo0eKCM94U03Fq9HzygsfMzNaNF8lQeb2P/3wXjZw1Ttz TzOPPVxLHyTCrz2jl0Wd1iDuwARQRN7EUHQDr2W9idaaZZe49DxZPLQUnK3HAniyPhD6 tedNGkUgnkEnVf9LX/UFXoWs7nDaMUqcPeCF2f5P5b9UcPSByYJYE6zKHPX45Rt7uL8B uiXD56I2gCpjhG7hKnrMmYLxYGqQhCtGdAz7jgDwcg5Sk+V0z9vJ/O7dppcwMz1+HKhZ Jo5kpnq9imRdEIHdK+3h1FiiBnVQ2Vb/xAoAa6BasTzzAjo6qWlCGdKRcBnvAuHCHUrh I1Ow== Received: by 10.50.160.165 with SMTP id xl5mr1431200igb.0.1349448976207; Fri, 05 Oct 2012 07:56:16 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp130653igc; Fri, 5 Oct 2012 07:56:15 -0700 (PDT) Received: by 10.180.86.34 with SMTP id m2mr3898167wiz.14.1349448974844; Fri, 05 Oct 2012 07:56:14 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.187]) by mx.google.com with ESMTPS id o52si3771417wee.89.2012.10.05.07.56.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Oct 2012 07:56:14 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.187; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0LoekB-1Tv81T1crr-00glN1; Fri, 05 Oct 2012 16:55:52 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, arm@kernel.org, Arnd Bergmann , Russell King , Dave Martin Subject: [PATCH 16/16] ARM: pass -marm to gcc by default for both C and assembler Date: Fri, 5 Oct 2012 16:55:30 +0200 Message-Id: <1349448930-23976-17-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349448930-23976-1-git-send-email-arnd@arndb.de> References: <1349448930-23976-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:GaMq6vHmG+eNjLso1sAmxumG4Ta56yyIkdrvU13HZA1 qyjEzu7543Dz05SOGKXldicxER5SgOLDiDhjBqbQ1+4habX3bK hAPlMLDI+wKfdYrKC92wruN7gmQ/QrJSivBOj8KvAz+RaOUofw zUaS16fhU2uaw5enX1WnEmxNa4GWMGcrOqw1/2lGzlFFGjBo5P tyQXIIoYc0iVImIcwSbJETRNG2UzrpgVrjetr+OSQPckIP0qyp lYhEGC0aV6bAG5hCwAqgs90lECOjXLqr2MOBbB4cqJ7pcPYqum Cvv+pp0WPDe+YYW3bev3R5LbALc6n6W1qDkteNbgwNwWiUfWYI KQx+gyvYEiQHNoL7uPjUW3iNPTfxQWfxyXspLNBqV8pLpHMIxQ en4lzPcRCUXdQP76dIEYQh0iUexCgO1GPA= X-Gm-Message-State: ALoCoQm0t92Bkze+uCKeugL97jU8V/OFEPSBko+cu4yPdgepd57S3rL1haj8jDjxcjD6B/hOdm/u 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 --- arch/arm/Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a051dfb..4391427 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__