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 2EBB3CD4F49 for ; Fri, 14 Nov 2025 04:29:18 +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=zvVbc4fxNEAv0H8SVSwfkv3w+FSB4HghNllH7RehaMs=; b=ktV8Lnsv1fiLT8 /XPvQ4VJEsmcyY0BSoMjhh0R0ldF9KZ6BEmKr8cfPY3RgVYhHLpkcStlLA7+VH0AYNOq733nXR/JR VyhSY3e67+tRH0U/5wZZ9Jl4AwsyWvdmZaOIaV9DgoSxqXdH0vAXpobyYCLbc+qySmDaZ9gh0DRX2 zl+FJs8E8JEUl5adKYOOp0aHsDtl9uT02QrpeLhRZYhdrijqYVGtLiUYcKbS5DGxcWpdbafxGAkx/ VTSb00QAA48K8H8CaSE/yM+NiuY655V2S3LDXceCzWEJ7LrSD+aBga8xd/lpJd6ODRz7cLdm4thRW bKvESxHoeo5G2FgEy4Tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vJlQp-0000000BXig-0cqG; Fri, 14 Nov 2025 04:29:07 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vJlQo-0000000BXi7-2Iv9 for linux-riscv@lists.infradead.org; Fri, 14 Nov 2025 04:29:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A43B160128; Fri, 14 Nov 2025 04:29:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D3C0C16AAE; Fri, 14 Nov 2025 04:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763094545; bh=pNnQKFMOXRv/8psHWwl6fS+z0lU+MW1Zt3XGUGS81hw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z5ruQ2MtWCS6I6U+6vV1Z+0TCZU6f+9X82zJurev+eP9mNn3Gh1vAhiv0QiwoIgDg zObjRFsSETG+fc2lcJT/61HwvIHiOgslQGjxQspUtVRm6JBsrvcGQBfsAjVpoHgTeV kipy8eHjNGe6zaKCO7/sCwj9xEVqvu9C3WlQlKiE25AwY5zeCaucNEuQCeBqHUy+Jy k6/FaVMxodHyCWO6HT7dwztd6e/5oJfmcPp5qfHfrsWJ4si05H1uZfaFCbzoAJG3TI f7WRio/5YJEIzHBD6QhspVqEWtVVeKZBGJrXqqIXnyJO2sQoHHj+9LuPyZ95opyZTl p9xMfxseUX/8Q== Date: Thu, 13 Nov 2025 21:28:56 -0700 From: Nathan Chancellor To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Nicolas Schier , Nicolas Schier , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Thomas Bogendoerfer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "David S. Miller" , Andreas Larsson , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Masahiro Yamada , linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, sparclinux@vger.kernel.org Subject: Re: [PATCH v2 02/10] init: deduplicate cc-can-link.sh invocations Message-ID: <20251114042856.GB3582402@ax162> References: <20251014-kbuild-userprogs-bits-v2-0-faeec46e887a@linutronix.de> <20251014-kbuild-userprogs-bits-v2-2-faeec46e887a@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20251014-kbuild-userprogs-bits-v2-2-faeec46e887a@linutronix.de> 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Oct 14, 2025 at 03:05:17PM +0200, Thomas Wei=DFschuh wrote: > The command to invoke scripts/cc-can-link.sh is very long and new usages > are about to be added. > = > Add a helper variable to make the code easier to read and maintain. > = > Signed-off-by: Thomas Wei=DFschuh Reviewed-by: Nathan Chancellor > --- > init/Kconfig | 4 ++-- > scripts/Kconfig.include | 3 +++ > 2 files changed, 5 insertions(+), 2 deletions(-) > = > diff --git a/init/Kconfig b/init/Kconfig > index cab3ad28ca49e7ac930207c9cde8d431d55dc7af..7b722e714d5c5a0580467914b= 226dc0700ec0797 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -84,8 +84,8 @@ config RUSTC_LLVM_VERSION > = > config CC_CAN_LINK > bool > - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS= ) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT > - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS= ) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag)) > + default $(cc_can_link_user,$(m64-flag)) if 64BIT > + default $(cc_can_link_user,$(m32-flag)) > = > # Fixed in GCC 14, 13.3, 12.4 and 11.5 > # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113921 > diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include > index 33193ca6e8030e659d6b321acaea1acd42c387a4..d42042b6c9e243b46d1626d89= 2c0c986621ce462 100644 > --- a/scripts/Kconfig.include > +++ b/scripts/Kconfig.include > @@ -65,6 +65,9 @@ cc-option-bit =3D $(if-success,$(CC) -Werror $(1) -E -x= c /dev/null -o /dev/null,$ > m32-flag :=3D $(cc-option-bit,-m32) > m64-flag :=3D $(cc-option-bit,-m64) > = > +# Test whether the compiler can link userspace applications > +cc_can_link_user =3D $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $= (CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(1)) > + > rustc-version :=3D $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC)) > rustc-llvm-version :=3D $(shell,$(srctree)/scripts/rustc-llvm-version.sh= $(RUSTC)) > = > = > -- = > 2.51.0 > = _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv