[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251113102236-1954dc76-ad1b-423d-ad29-104c3e07db17@linutronix.de>
Date: Thu, 13 Nov 2025 10:22:58 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Nicolas Schier <nsc@...nel.org>
Cc: Nathan Chancellor <nathan@...nel.org>, Paul Walmsley <pjw@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>, Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>, Sven Schnelle <svens@...ux.ibm.com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>, Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>, Christophe Leroy <christophe.leroy@...roup.eu>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
"David S. Miller" <davem@...emloft.net>, Andreas Larsson <andreas@...sler.com>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>, linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-mips@...r.kernel.org, sparclinux@...r.kernel.org
Subject: Re: [PATCH v2 03/10] kbuild: allow architectures to override
CC_CAN_LINK
On Wed, Nov 12, 2025 at 08:56:12PM +0100, Nicolas Schier wrote:
> On Tue, Oct 14, 2025 at 03:05:18PM +0200, Thomas Weißschuh wrote:
> > The generic test for CC_CAN_LINK assumes that all architectures use -m32
> > and -m64 to switch between 32-bit and 64-bit compilation. This is overly
> > simplistic. Architectures may use other flags (-mabi, -m31, etc.) or may
> > also require byte order handling (-mlittle-endian, -EL). Expressing all
> > of the different possibilities will be very complicated and brittle.
> > Instead allow architectures to supply their own logic which will be
> > easy to understand and evolve.
> >
> > Both the boolean ARCH_HAS_CC_CAN_LINK and the string ARCH_USERFLAGS need
> > to be implemented as kconfig does not allow the reuse of string options.
> >
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
> > ---
> > Makefile | 13 +++++++++++--
> > init/Kconfig | 4 ++++
> > 2 files changed, 15 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 17cfa11ca7163aa3297101ceb3c9e85f4878f12d..26e5bca534e27034c355939bca4c90db435ecdbd 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1134,8 +1134,17 @@ ifneq ($(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS),)
> > LDFLAGS_vmlinux += --emit-relocs --discard-none
> > endif
> >
> > -# Align the bit size of userspace programs with the kernel
> > -USERFLAGS_FROM_KERNEL := -m32 -m64 --target=%
> > +# Align the architecture of userspace programs with the kernel
> > +USERFLAGS_FROM_KERNEL := --target=%
> > +
> > +ifdef CONFIG_ARCH_USERPROGS_CFLAGS
>
> Is this some left-over from a previous version?
>
> s/CONFIG_ARCH_USERPROGS_CFLAGS/CONFIG_ARCH_USERFLAGS/
Indeed. Thanks.
Powered by blists - more mailing lists