From patchwork Wed May 27 09:42:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 6488521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C94E7C0020 for ; Wed, 27 May 2015 09:45:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3BAB2068E for ; Wed, 27 May 2015 09:45:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEDFC2064B for ; Wed, 27 May 2015 09:45:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxXrP-0003ob-FP; Wed, 27 May 2015 09:42:51 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxXr7-0003eY-BI for linux-arm-kernel@lists.infradead.org; Wed, 27 May 2015 09:42:34 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YxXqj-00031Z-Tl; Wed, 27 May 2015 11:42:09 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.85) (envelope-from ) id 1YxXqj-0007WB-Fm; Wed, 27 May 2015 11:42:09 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC] ARM: use -marm unconditionally for THUMB2_KERNEL=n builds Date: Wed, 27 May 2015 11:42:07 +0200 Message-Id: <1432719727-28860-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150527_024233_677194_DEDB785F X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -0.0 (/) Cc: kernel@pengutronix.de, Arnd Bergmann , Nicolas Pitre X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When using a toolchain that defaults to v7-m code generation using cc-option fails to add -marm because it conflicts with the default cpu type: $ echo > test.c $ arm-cortexm3-uclinuxeabi-gcc -marm -c test.c test.c:1:0: error: target CPU does not support ARM mode resulting in errors like Error: selected processor does not support Thumb mode `mrs r1,cpsr' Dropping the use of cc-option and using -marm unconditionally works fine for this compiler because it's only ever used together with $(arch-y) (e.g. -march=armv4). 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. The next best fix is using CFLAGS_ISA := $(call cc-option,$(arch-y) -marm,) and dropping arch-y from KBUILD_CFLAGS in case this change breaks gcc 3.x. Signed-off-by: Uwe Kleine-König --- Hello, Arnd told me on irc that Nico did some build tests with ancient compilers some time ago. Maybe you can tell which was the first compiler to support -marm? Best regards Uwe arch/arm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 0ce9d0f71f2a..6773c74a8f8b 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -115,8 +115,8 @@ 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) +CFLAGS_ISA := -marm +AFLAGS_ISA := $(CFLAGS_ISA) endif # Need -Uarm for gcc < 3.x