From mboxrd@z Thu Jan 1 00:00:00 1970 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 13B6BC433F5 for ; Fri, 8 Apr 2022 17:18:38 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pTC+xNAojfgDwjmvCdn3jjTX5yN1RgxrzBlZrclYafs=; b=FsjNCKZD3qgAvZ 5XNArfsFPfsUaQpcv+eBxW1Xu2OK82LBEMx6rBpC2dU2mGDmFTlUlD31H8O0wbsg/XskklYF8X7yV QndfCYTvB8+NlYzP/IgDqguqiwZi+Mtq20NZU/Mn5JzNJCBsehQx/ohnP4VJhxvCa1kziIbaXQnrF Hasudy+0M82uwHVworJHsj0dE4ayqm6oLyXB+V5VsXPuTmw9SHOq3qaFEA5VSaNkBPd2/U9Jdncos rBmzVp/LmooAJ0VDwFOf3VO8IIDlUs0eXyMTesMWZSATmBQWEpRcsea6sPrsPlIyI2y1WMvUE+eg3 t4jWIk9td0N51hOJb7Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncsEm-000gxB-4P; Fri, 08 Apr 2022 17:17:32 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncsEi-000gvd-5o for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 17:17:30 +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 ams.source.kernel.org (Postfix) with ESMTPS id B9345B82C42; Fri, 8 Apr 2022 17:17:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26B63C385A3; Fri, 8 Apr 2022 17:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649438241; bh=d+Qeslc+SmOkv7dVikrp4t2z05cWPHgwJBS072Owyt8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HFIZFDTmMf54qS2k2Vdl5vuqrFyK15XPEk+lhn7wya+jXuvu1B1difIvkfQtMEPuw FOSLhHctvdQhWU455RSDTqeZMP5lukLZkoqXwDMKVDYNpgYnZoTerXpB9UWgjYPgK+ mBlpm+0RBbjAeitjgjqr4tL96Z7+LgPSfapKeXg4AGiLCuMWr43wG+90vrFP45BGA6 cwxqua3KU01NbZGhJJ3s26JUk0A9TTNr2UaeouPpOpyZDPowt5oEsJDMQVtI1y9lws DhVG7+2jtB71I1+OBHvVWozQtGgWwsz2BNnn1+Be0EhfHMvMEVhK+Yj7pj2RS95sbo M1UfWutc4WDYw== Date: Fri, 8 Apr 2022 10:17:19 -0700 From: Nathan Chancellor To: Will Deacon Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, keescook@chromium.org, ardb@kernel.org Subject: Re: allmodconfig builds failing to link on arm64 Message-ID: References: <20220408115407.GA27685@willie-the-truck> <20220408161344.GA28108@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220408161344.GA28108@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_101728_549504_D930D0C1 X-CRM114-Status: GOOD ( 30.83 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 08, 2022 at 05:13:44PM +0100, Will Deacon wrote: > On Fri, Apr 08, 2022 at 04:06:39PM +0100, Mark Rutland wrote: > > On Fri, Apr 08, 2022 at 03:45:42PM +0100, Mark Rutland wrote: > > > On Fri, Apr 08, 2022 at 12:54:07PM +0100, Will Deacon wrote: > > > > Since -rc1 (although I haven't tried bisecting the merge window), I'm > > > > not able to link allmodconfig for arm64: > > > > > > > > aarch64-linux-gnu-ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.init_array.1' in virt/lib/irqbypass.o] sections > > > > aarch64-linux-gnu-ld: final link failed: bad value > > > > make: *** [Makefile:1158: vmlinux] Error 1 > > > > > > > > I'm using an Android clang based on 12.0.6 and LD claims to be > > > > 2.33.1.20191209. > > > > > > I can reproduce that when using the llvm.org 12.0.0 binaries along with the > > > kernel.org crosstool 9.2.0 binaries (binutils 2.32) to build v5.18-rc1 > > > allmodconfig. > > > > > > I see the failure with (at least) the following combinations that I tested: > > > > > > * LLVM 11.0.0 && binutils 2.34 (kernel.org 8.4.0 binaries) > > > * LLVM 12.0.0 && binutils 2.30 (kernel.org 8.1.0 binaries) > > > * LLVM 12.0.0 && binutils 2.32 (kernel.org 9.2.0 binaries) > > > * LLVM 12.0.0 && binutils 2.34 (kernel.org 8.4.0/9.3.0 binaries) > > > * LLVM 13.0.0 && binutils 2.34 (kernel.org 8.4.0 binaries) > > > * LLVM 14.0.0 && binutils 2.34 (kernel.org 8.4.0 binaries) > > > > > > I *DO NOT* see the failure with the following combinations: > > > > > > * LLVM 12.0.0 && binutils 2.36.1 (kernel.org 10.3.0/11.1.0 binaries) > > > * LLVM 13.0.0 && binutils 2.36.1 (kernel.org 10.3.0/11.1.0 binaries) > > > * LLVM 14.0.0 && binutils 2.36.1 (kernel.org 10.3.0/11.1.0 binaries) > > > > > > So clearly something changed on the binutils side between 2.34 and > > > 2.36.1, but I don't know whether either behaviour is incorrect, or > > > whether LLVM implicitly depends upon a newer binutils version. > > > > > > I don't know why this suddenly became a problem in v5.18-rc1; I'll have > > > a look. > > > > I also see this with earlier kernel versions, including: > > > > * v5.15 allmodconfig, LLVM 12.0.0, binutils 2.30 (kernel.org 8.1.0 binaries) > > * v5.16 allmodconfig, LLVM 12.0.0, binutils 2.30 (kernel.org 8.1.0 binaries) > > * v5.17 allmodconfig, LLVM 12.0.0, binutils 2.30 (kernel.org 8.1.0 binaries) > > > > ... so it doesn't look like this is a (recent) regression. > > Damn, sorry for the mis-diagnosis then. I only just started seeing it, but > thinking about it I _usually_ build with LLVM=1 which probably rules out > binutils entirely. For some reason, I ended up in the mixed case today > and ran into this. > > In any case, it would be good to get it resolved and I'm happy to test out > any fixes. I came up with the following diff. I could make the second "depends on" line a little more readable by splitting it out to two different symbols such as GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS and CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS, which lines up with Linus' preference here: https://lore.kernel.org/r/CAHk-=whzW56xChey=k+9KeK_NFxWLfZrt5UWvVjTxYbHLP1Nwg@mail.gmail.com/ That decision is ultimately up to you all though! I can formally send this along if it looks okay or rework it here depending on feedback. Cheers, Nathan diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 57c4c995965f..b2a10846608a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -175,8 +175,6 @@ config ARM64 select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE - select HAVE_DYNAMIC_FTRACE_WITH_REGS \ - if $(cc-option,-fpatchable-function-entry=2) select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ if DYNAMIC_FTRACE_WITH_REGS select HAVE_EFFICIENT_UNALIGNED_ACCESS @@ -228,6 +226,13 @@ config ARM64 help ARM 64-bit (AArch64) Linux support. +config TOOLCHAIN_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS + def_bool y + depends on $(cc-option,-fpatchable-function-entry=2) + # https://github.com/ClangBuiltLinux/linux/issues/1507 + depends on CC_IS_GCC || (CC_IS_CLANG && LD_IS_LLD) || (CC_IS_CLANG && LD_VERSION >= 23600) + select HAVE_DYNAMIC_FTRACE_WITH_REGS + config 64BIT def_bool y _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel