From patchwork Tue Oct 9 15:23:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12071 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 3537623F6D for ; Tue, 9 Oct 2012 15:23:41 +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 C9539A18835 for ; Tue, 9 Oct 2012 15:23:40 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so11480968iej.11 for ; Tue, 09 Oct 2012 08:23:40 -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=ynEBnVzdilmJMZWKKMmdKM7mQvfHZ+KkHDKKFt927GQ=; b=ITTuKQL12E5BwfTLKEeAf+3/5/eHoLh0OkoBuTD05N45khNLinsWF4Pao/npa2sEBt F6BOUOQRm1o3RbCajEYQU3NiOQQ1geu30UDwee727NeyxHk3BLNlliz2DcVg8kNIwq4B 8t6dBQ0/AOcXvfnxfMDHwFuddtUmyPqOHemywRaJ+rjzdxAHk7vREuXXpknV5Ar/PiYw 9jMsq5uBm+G7ZZ//K8+To8x2Fl7dQP4l4jw4u3C9dHmVBNeVRx//lki9EaU3nXHKyhaK lO7c4txZ847Tll2YEBAPaXtCWfAXptiSS6m/LNhwQoXMPf7qrAefPdzDsF1+UbLbqRma q1rg== Received: by 10.50.157.201 with SMTP id wo9mr2019357igb.57.1349796220553; Tue, 09 Oct 2012 08:23:40 -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.67.148 with SMTP id n20csp73096igt; Tue, 9 Oct 2012 08:23:39 -0700 (PDT) Received: by 10.216.214.92 with SMTP id b70mr13091550wep.86.1349796218883; Tue, 09 Oct 2012 08:23:38 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.187]) by mx.google.com with ESMTPS id o3si26278069wic.0.2012.10.09.08.23.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 08:23:38 -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=mrbap4) with ESMTP (Nemesis) id 0LjsL3-1TxQNI3qBd-00cSIw; Tue, 09 Oct 2012 17:23:26 +0200 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Dave Martin Subject: [PATCH 6/9] ARM: pass -marm to gcc by default for both C and assembler Date: Tue, 9 Oct 2012 17:23:00 +0200 Message-Id: <1349796183-30648-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349796183-30648-1-git-send-email-arnd@arndb.de> References: <1349796183-30648-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:cwv5BZuFx1Lqqbv9CipCAJF6W1gDpMmji/rvviMDbEs Xy/fqs5JjPuifV+5UjbLYV7FwXGK6dDTffBTEtlftHK8W/9W2a Wrdx11XQPHnmtsJQzfNhKAYSGX+FhofPtwjGlMaFkxCL7/i9fk qQGh9xFyzgzKEzREz+zyDHCAR5k6YQBuPylx3QIiEzjUUGbVfa kffEYOmglPdq/7Uii77sDNvJcNpC7kcsO5Sl53q/SukwJU356O AbGy2nNeZQ60+pj/LMrKaiHMOgpM9u5ZZwIvrpGtEh2j2Divi4 0p+MEx5cMhCHepxEsmp61YnWSpFNGj9aNCjMepkvFI4i8wzpH8 8IEpmlkcFTjQNwM8FoBGP7HY4uYUEZndULfZDCry9SU+AJSXDH cHILArEtfMmXGtxmlwUQsD/IrO1XyxmUpM= X-Gm-Message-State: ALoCoQkcgMYNjliflKH32kvqGiwf52nZrVkVDjJmwdC4Y9E7TbEOh+qXZvEuGYIqDoCooyBvWBQa 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 Acked-by: Nicolas Pitre 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 f023e3a..5f914fc 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__