From patchwork Tue Feb 9 00:57:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12076947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 771F8C433DB for ; Tue, 9 Feb 2021 00:59:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28C4E64E82 for ; Tue, 9 Feb 2021 00:59:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28C4E64E82 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R1Huyd6BpWYop2dP1ekFzBSBFRWaDuDIJKRUtv+3s3c=; b=YpnypxBQ0uVRqhIOo4vD9XXY3 roMgx37BQ4TK87E9o/DaE66D+16uCbN85OaaC0q5Q5POMYFI/Xsq51p9IGtmBtOsWxz68d3mrp3AS Hkez3zq2rZVKKLrKw1G3HkY93+GMEj8BK0THXm1ivufrxgYAttq9Qg2WrwdxWMYXs2+RpXYP83vTY atb/dfCiQIs3ZIhgmc5a0xB8+MxM4ReFpBxuCCgyQ+LeyGBVKKHI/TA+9GfbmgPoXa1iODYF14iYc eKUUYtU0dteNCJe6wFC5e6gBr1BZsA1wmu+fSHAPnHvpjWuRJ0xO6AKyE2hlUNo/fztiAcPwp9lfG GiBY76sGQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9HMc-0002y5-ER; Tue, 09 Feb 2021 00:58:46 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9HMa-0002xN-Iq for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 00:58:45 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E556464E82; Tue, 9 Feb 2021 00:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612832322; bh=WTzVfyDECWyda2V3zd0/237OY1tpljp4GOvC63bQyIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PrAK/jQGItiwbV2qgsJ/REd2PxX8xY0hxWCzpJ3g0zw3C1P3nAfuoc3weeFg+S562 c/Tx5gj0cke5MV99TYssKctfV4Yx9uo4aGiLToBUr3qdM7cVEj2NnHTCvwzGkMh0lm LKUBTqqbELpeKa3KZisgPSxCJhSIJkqmjOisV1+RrIqntXGGj2+VbHyqE+jT7o4evI vesnTcCAlTdyadlWcrGug31us/UhtHq9CYXbYdp0CO+wzpSD1nRteVZdKmi+Ehcoyo emavb04ynMAQAAmN9+GabfUnnpYhTeCjvHUbI2nYQUHcXkN/WafFyEzAIXFV4uL+AY i88GixNIhfw/A== From: Nathan Chancellor To: Catalin Marinas , Will Deacon Subject: [PATCH v2] arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+ Date: Mon, 8 Feb 2021 17:57:20 -0700 Message-Id: <20210209005719.803608-1-nathan@kernel.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210202022441.1451389-1-nathan@kernel.org> References: <20210202022441.1451389-1-nathan@kernel.org> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_195844_716404_22D50080 X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Nick Desaulniers , linux-kernel@vger.kernel.org, Nathan Chancellor , clang-built-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Similar to commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN depends on !LD_IS_LLD"), ld.lld prior to 13.0.0 does not properly support aarch64 big endian, leading to the following build error when CONFIG_CPU_BIG_ENDIAN is selected: ld.lld: error: unknown emulation: aarch64linuxb This has been resolved in LLVM 13. To avoid errors like this, only allow CONFIG_CPU_BIG_ENDIAN to be selected if using ld.bfd or ld.lld 13.0.0 and newer. While we are here, the indentation of this symbol used spaces since its introduction in commit a872013d6d03 ("arm64: kconfig: allow CPU_BIG_ENDIAN to be selected"). Change it to tabs to be consistent with kernel coding style. Link: https://github.com/ClangBuiltLinux/linux/issues/380 Link: https://github.com/ClangBuiltLinux/linux/issues/1288 Link: https://github.com/llvm/llvm-project/commit/7605a9a009b5fa3bdac07e3131c8d82f6d08feb7 Link: https://github.com/llvm/llvm-project/commit/eea34aae2e74e9b6fbdd5b95f479bc7f397bf387 Reported-by: Arnd Bergmann Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- v1 -> v2: * Conditionally disable CONFIG_CPU_BIG_ENDIAN for older versions of ld.lld now that proper support has been added to ld.lld 13+ (thanks to the quick work of Fangrui Song). arch/arm64/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) base-commit: 92bf22614b21a2706f4993b278017e437f7785b3 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index f39568b28ec1..912da4e2ab59 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -952,8 +952,9 @@ choice that is selected here. config CPU_BIG_ENDIAN - bool "Build big-endian kernel" - help + bool "Build big-endian kernel" + depends on !LD_IS_LLD || LLD_VERSION >= 130000 + help Say Y if you plan on running a kernel with a big-endian userspace. config CPU_LITTLE_ENDIAN