From patchwork Wed Jan 18 19:22:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13106967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A8A1C32793 for ; Wed, 18 Jan 2023 19:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MTqsHBDwk2U6HIoVf8UJGAuaj6tlN+tEC4jcRCZ1fgI=; b=E6NrCfAj5jngno EdMM7v+/zz9mlNa0m4eZx3f9eJ8lqtqyaRmeVsomB3xJ5KuPmllE5eEmBRpbSEqU2X4skKpbXbTSh R4R1hAzy9FkhO0S/QMddlY5tOZIDiaX73nTbLwvGvBAS8TTZBMlVa2vwjT+pK1gEk7LcWGn0vCuT9 UZ53qJGPx6JxEqmlg/mgte6d+AsCG7reLkGGPGSlqQVZ661GoU1EgzaPiTeMmEuB5ML+rbuLl7iz1 6w/7dRpl/XZ/XHvPj38WUcxI0bD0V3doXXLY0uW1UJ3ycVG22mMTJkISSh7z9W85gc9bbahZNByHp 0+v4fEeK9UbplTN6X+/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIE21-002Tq8-5T; Wed, 18 Jan 2023 19:23:33 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIE1s-002Tmt-54 for linux-arm-kernel@lists.infradead.org; Wed, 18 Jan 2023 19:23:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AFDE5619E6; Wed, 18 Jan 2023 19:23:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BCB3C433D2; Wed, 18 Jan 2023 19:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674069802; bh=0ya5K5vjVFPW7YzbbDzDGC2Lwm5m4bGSEj8L7qF73aE=; h=From:Date:Subject:To:Cc:From; b=EwpuW/gobuiyeXJs2dQ4kbN14sQEOWf/f8Lxa8Kkrf9gX2uBQW8IikL84yL5nqOUU jLtjRLiYds2rRqxwDqod9XyJS36xOD68fxAIl4pWMI8O7FxAlQYfIxSyVA/H4Z5uBl nHQCRDmzy/GghPNk+Vc1RIg3PfgqLu7Vj0vX0DbcLc8WTDOdCTo6i3w7G/FSqQm1Zn vxJXpPlstBhJBnp5VnqmL+IyeFDBkcxfm7c9vKNt9zV5X3N0bLLmodEbSCUUS1uL4I +ItgfsgroRhpr3DYHGcEX4MP01SoVAX5FK19SaXLMPyH20SsfPhMviowjvA9ioT+eE 39vvDeYR6IwqA== From: Nathan Chancellor Date: Wed, 18 Jan 2023 12:22:59 -0700 Subject: [PATCH] ARM: Allow pre-ARMv5 builds with ld.lld 16.0.0 and newer MIME-Version: 1.0 Message-Id: <20230118-v4-v4t-lld-16-v1-1-e3d9a00ae47c@kernel.org> X-B4-Tracking: v=1; b=H4sIABRHyGMC/x2N0QqDMAxFf0XyvICts0x/ZfhQ02wGXJVEZCD++ +rgvhwuh3OAsQob9NUByruYLLmAu1VAU8xvRkmFwde+qZ174H4v23CeE7qAXUhtaomaQB6KM0Zj HDVmmi7rE21jvY5V+SXff+g5nOcPBT2DQXgAAAA= To: linux@armlinux.org.uk, arnd@arndb.de Cc: ndesaulniers@google.com, trix@redhat.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2188; i=nathan@kernel.org; h=from:subject:message-id; bh=0ya5K5vjVFPW7YzbbDzDGC2Lwm5m4bGSEj8L7qF73aE=; b=owGbwMvMwCEmm602sfCA1DTG02pJDMkn3DX7ptX3yk/buub+p7cHnHw+Ho74v3H/xcuZm7Zo5B3c pBZY1VHKwiDGwSArpshS/Vj1uKHhnLOMN05NgpnDygQyhIGLUwAmsqSBkaGFr9akoUciZIb4grYGp3 WX7luftRZ7qJvY+N5CZFb0lFBGhht8B/S9lZgZ9KXKRMTr/WMOCO06m3vGdnf+icBtr+1VmAE= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230118_112324_352242_FA069874 X-CRM114-Status: GOOD ( 15.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 6a7ee50f8f56 ("ARM: disallow pre-ARMv5 builds with ld.lld") prevented v4 or v4t kernels when ld.lld will link the kernel due to inserting unsupported blx instructions. ld.lld has been fixed in current main (16.0.0) to avoid inserting these instructions by inserting position independent thunks instead. Allow these configurations to be enabled when ld.lld 16.0.0 is used to link the kernel. Additionally, add a link to the upstream LLVM issue so that the reason for this dependency is clearly documented. Link: https://github.com/ClangBuiltLinux/linux/issues/964 Link: https://github.com/llvm/llvm-project/commit/6f9ff1beee9d12aca0c9caa9ae0051dc6d0a718c Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Tested-by: Arnd Bergmann --- I just build tested: - multi_v4t_defconfig without 6a7ee50f8f56 with LLVM 15: warning - multi_v4t_defconfig with this patch with LLVM 16: no warning and the configuration cannot be selected under the old and new conditions still. --- arch/arm/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- base-commit: 5dc4c995db9eb45f6373a956eb1f69460e69e6d4 change-id: 20230118-v4-v4t-lld-16-96d5d5cc36c2 Best regards, diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 43c7773b89ae..874c5b56cf9a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -345,14 +345,16 @@ comment "CPU Core family selection" config ARCH_MULTI_V4 bool "ARMv4 based platforms (FA526, StrongARM)" depends on !ARCH_MULTI_V6_V7 - depends on !LD_IS_LLD + # https://github.com/llvm/llvm-project/issues/50764 + depends on !LD_IS_LLD || LLD_VERSION >= 160000 select ARCH_MULTI_V4_V5 select CPU_FA526 if !(CPU_SA110 || CPU_SA1100) config ARCH_MULTI_V4T bool "ARMv4T based platforms (ARM720T, ARM920T, ...)" depends on !ARCH_MULTI_V6_V7 - depends on !LD_IS_LLD + # https://github.com/llvm/llvm-project/issues/50764 + depends on !LD_IS_LLD || LLD_VERSION >= 160000 select ARCH_MULTI_V4_V5 select CPU_ARM920T if !(CPU_ARM7TDMI || CPU_ARM720T || \ CPU_ARM740T || CPU_ARM9TDMI || CPU_ARM922T || \