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 BFABEC87FCB for ; Fri, 8 Aug 2025 21:53:20 +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=+zam23heSAhyzG9/mht1COW/hojRdRAJC5zGMFZSAKQ=; b=2pTpX2Yfxth8pV fTs687c3lt09XdLRQA2gdLHW8LnrBu1EjwoE64iGbU2vO5ED7utNhvHKj65fLXquBvOtTxnvhO6yK uZI1W9BZzWkip5+aDL/NcRCpajiQBeU9BN3akAKajKadxd14ydDkzGl4QLWzycaHNKZ47T2hjxPSK VnC7Nuw7D+tUganTLDZAurU6SKtZp5T6gMrlM8SlJ4mEe8EIDJBY/3zu0NkJt8DmQYZgRrazkmh4f mxPB4gl+sriB8BRqCmVapviA/+PVCs315n9ZicfnG1pCpABvThdltxivQQba29outPMYJRI++xLnT KTEhu4KJUInfRQcJViUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ukV1T-00000003kq0-0EEs; Fri, 08 Aug 2025 21:53:11 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ukV1Q-00000003kp5-42nb for linux-riscv@lists.infradead.org; Fri, 08 Aug 2025 21:53:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 15B5845B5E; Fri, 8 Aug 2025 21:53:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BBF9C4CEF7; Fri, 8 Aug 2025 21:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754689988; bh=ATwyecHxTopAmdm8049OI8LQGrc6qa1zmAS8EZn7Zt8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GKeUBHurZI5lwaUwpKrVDYzX+jl120VmMnO8rd1hLSEncWyHHLlvSQUQ0V6RrAGvh k8PX1UOMHjoewQLicxQpKX0t/aTlT7BsLimcG8SiAsT8mxzmVXhAwmMl2OO3OFXTg7 r5bfqx8yWCP4X7gJPUhnOLaegu0pWWFsNxjyv4Ila6q+KCVAY+hg+7x/fbq7mM9Kqm Dfif4kc4qvab5OIFditOH5flk6ovpuod7PMkVMGLBfQcmS9EpjNdJ/2NJ9hvZoJfpC 6jwDq7oiF9stAZmPTDQZFX2a5KZPhOFidvwgKfP5JjhcaYJQc5MsobHP8yE6kMQLLP Fki4vJFUinaEA== Date: Fri, 8 Aug 2025 14:53:03 -0700 From: Nathan Chancellor To: Palmer Dabbelt , Alexandre Ghiti Cc: Conor Dooley , linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel test robot Subject: Re: [PATCH] riscv: Only allow LTO with CMODEL_MEDANY Message-ID: <20250808215303.GA3695089@ax162> References: <20250710-riscv-restrict-lto-to-medany-v1-1-b1dac9871ecf@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250710-riscv-restrict-lto-to-medany-v1-1-b1dac9871ecf@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250808_145309_022524_B423C62F X-CRM114-Status: GOOD ( 21.41 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Ping? This is still getting hit. On Thu, Jul 10, 2025 at 01:25:26PM -0700, Nathan Chancellor wrote: > When building with CONFIG_CMODEL_MEDLOW and CONFIG_LTO_CLANG, there is a > series of errors due to some files being unconditionally compiled with > '-mcmodel=medany', mismatching with the rest of the kernel built with > '-mcmodel=medlow': > > ld.lld: error: Function Import: link error: linking module flags 'Code Model': IDs have conflicting values: 'i32 3' from vmlinux.a(init.o at 899908), and 'i32 1' from vmlinux.a(net-traces.o at 1014628) > > Only allow LTO to be performed when CONFIG_CMODEL_MEDANY is enabled to > ensure there will be no code model mismatch errors. An alternative > solution would be disabling LTO for the files with a different code > model than the main kernel like some specialized areas of the kernel do > but doing that for individual files is not as sustainable than > forbidding the combination altogether. > > Cc: stable@vger.kernel.org > Fixes: 021d23428bdb ("RISC-V: build: Allow LTO to be selected") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202506290255.KBVM83vZ-lkp@intel.com/ > Signed-off-by: Nathan Chancellor > --- > arch/riscv/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 36061f4732b7..4eee737a050f 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -68,7 +68,7 @@ config RISCV > select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE > select ARCH_SUPPORTS_HUGETLBFS if MMU > # LLD >= 14: https://github.com/llvm/llvm-project/issues/50505 > - select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000 > + select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000 && CMODEL_MEDANY > select ARCH_SUPPORTS_LTO_CLANG_THIN if LLD_VERSION >= 140000 > select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS if 64BIT && MMU > select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU > > --- > base-commit: fda589c286040d9ba2d72a0eaf0a13945fc48026 > change-id: 20250710-riscv-restrict-lto-to-medany-f1b7dd5c9bba > > Best regards, > -- > Nathan Chancellor > _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv