From patchwork Sun Sep 30 02:49:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 147852 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2441502lji; Sat, 29 Sep 2018 19:49:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61URvSHIw6xIKP0P9yYjtvyJEzkILxolvBvCYcFrqzYO/nUXrFS3Bcd0YZzWZI300cAI4n7 X-Received: by 2002:a65:498b:: with SMTP id r11-v6mr5001139pgs.153.1538275764273; Sat, 29 Sep 2018 19:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538275764; cv=none; d=google.com; s=arc-20160816; b=MsUCKdR7UYmp0tzT36tv84m+DAs9mOwuK00spTCJxVQBJa4MUfT5Hvz5iv0QtbzfOZ 6EGKWtay67yKee+GxT+c/OhNNTUNwyM/g+CQou9iUXDbvoTGBw5INvCO3jkkjax4ZU0g 3pyw/HFprvt9zXwjte9CfBaeWaGvGkAKuWxbS1b/KnXwrTRFoUddoNC5HK37WdzVLytO 4XcS1VHMJp73mXRy5/Bz4o5C/txBgfR7tUj4Lazq1w36z6qcAHyKO7qDOgFKXo8ZDhwb NY9ajawT677/ESH1G5rdvZpJXbLVN6aYS+2iIC5ppbrMbO7iAveLdK4+ZPxLKxa2PVov lkfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dXD5ww6N9WKvLUUwzYhFVkwy2WUJ2x1wb6rRDyykJ9A=; b=WcLhRFRKJ8dmVFX0iedvDaz2JUm0F2ad44MRQmv6PNm5ca9MKnxl9cAXtvZw73dqWt Y1THhNv194JU/I65OXevXIDvnR1K1mFtpeIMQwFlBj5gCVfYzLLmOa55TznAvgDSE4ff J/xSVpelv1+oM4YUZUOD+/ZHT42rtvV35+ChCW11leiQ985sCuNx1iLOdipviwGZQImP YdhDUGAhMxMmQenVRDcqA4Q+aK/8fTcnZtNssO+ZcsoY7xDQWGFUKzyzQFR5eTgpL4CW LdMv2TfHRABgQvOV/486Pka/Tmqq4zDn5yzSbe1tiGg/OHvO6zyBPCCUxmrrKYDkyQ2N oOkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=qlCYFqX4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 138-v6si8519048pga.188.2018.09.29.19.49.23; Sat, 29 Sep 2018 19:49:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=qlCYFqX4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727742AbeI3JUX (ORCPT + 32 others); Sun, 30 Sep 2018 05:20:23 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:55481 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727019AbeI3JUW (ORCPT ); Sun, 30 Sep 2018 05:20:22 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 371cc1ce; Sun, 30 Sep 2018 02:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=mail; bh=HEs5d1wDv40lXAoJ5hGdtyyyrSY=; b=qlCYFqX48DCIGGS+g2eG kb3b/IZWd3TZgXIBSpJlaqJge/vx98L312sSUYrSB1EW1jSXZCknEw7U0WKNDlgb hlIJdgRcDgzGUOx5Z3a7417D6rP0WlTzSvlbY49L2PLlpcJSMbygUvBBRUtNVvsU DW2bfy5pM7dzGxqMq3nRkkqhtuBZBwhPHW1XM2C2+iOhrysLGNm/vEBc54kRqsQv SPMgh1nMr4dlggxRb5CBzoBpGlRaUW96+GTXMXd2aavFd/ApT2fufmdHHwdq5PiU OIUg0mBk5Yvh01ZKg5nVhFQctTweifQVp3RHts4uwapK8njagrysLe38HCfWl1aH FA== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8447d7cf (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sun, 30 Sep 2018 02:30:19 +0000 (UTC) From: "Jason A. Donenfeld" To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arm@kernel.org Cc: "Jason A. Donenfeld" , Ard Biesheuvel Subject: [PATCH] ARM: makefile: pass -march=armv4 to assembler even on CPU32v3 Date: Sun, 30 Sep 2018 04:49:04 +0200 Message-Id: <20180930024904.14240-1-Jason@zx2c4.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Per the discussion about half-way down in [1], the kernel doesn't actually support the ARMv3 ISA, but selects it for some ARMv4 ISA hardware that benefits from ARMv3 code generation. Such a consideration, then, only applies to the compiler but not to the assembler. This commit passes -march=armv4 to the assembler in those cases, so that code written for ARMv4 will continue to compile and run fine, without needing module-specific asflags-y overrides. [1] https://lore.kernel.org/lkml/CAKv+Gu9FoFQymp2-=rUeh14CkUKON389OCE7stYCOFwKZpaCrg@mail.gmail.com/ Signed-off-by: Jason A. Donenfeld Cc: Ard Biesheuvel --- I don't have too much familiarity with hardware this old, nor access to testing systems, so please do carefully evaluate the assertions above before merging this, since I'm not sure I have a full understanding of the Linux ARMv3 situation. arch/arm/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.19.0 diff --git a/arch/arm/Makefile b/arch/arm/Makefile index d1516f85f25d..7a264cacb482 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -76,8 +76,14 @@ arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4 arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3 +# We do not actually support the ARMv3 ISA and prefer it above only for +# code generation purposes, which does not apply to assembly. So we pass +# v4 to the assembler, so that we can still assemble all instructions. +arch-asflags-$(CONFIG_CPU_32v3) =-march=armv4 + # Evaluate arch cc-option calls now arch-y := $(arch-y) +arch-asflags-y := $(arch-asflags-y) # This selects how we optimise for the processor. tune-$(CONFIG_CPU_ARM7TDMI) =-mtune=arm7tdmi @@ -130,7 +136,7 @@ endif # Need -Uarm for gcc < 3.x 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 +KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) $(arch-asflags-y) -include asm/unified.h -msoft-float CHECKFLAGS += -D__arm__