From: Nicolas Schier <nsc@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Nathan Chancellor <nathan@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
"David S. Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
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 03/10] kbuild: allow architectures to override CC_CAN_LINK
Date: Wed, 12 Nov 2025 20:56:12 +0100 [thread overview]
Message-ID: <aRTmXJVXlbkF2rI4@derry.ads.avm.de> (raw)
In-Reply-To: <20251014-kbuild-userprogs-bits-v2-3-faeec46e887a@linutronix.de>
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@linutronix.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/
Kind regards,
Nicolas
WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Schier <nsc@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Nathan Chancellor <nathan@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
"David S. Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
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 03/10] kbuild: allow architectures to override CC_CAN_LINK
Date: Wed, 12 Nov 2025 20:56:12 +0100 [thread overview]
Message-ID: <aRTmXJVXlbkF2rI4@derry.ads.avm.de> (raw)
In-Reply-To: <20251014-kbuild-userprogs-bits-v2-3-faeec46e887a@linutronix.de>
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@linutronix.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/
Kind regards,
Nicolas
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-11-12 20:03 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 13:05 [PATCH v2 00/10] kbuild: userprogs: introduce architecture-specific CC_CAN_LINK and userprog flags Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 01/10] kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-11-12 19:55 ` Nicolas Schier
2025-11-12 19:55 ` Nicolas Schier
2025-11-14 4:27 ` Nathan Chancellor
2025-11-14 4:27 ` Nathan Chancellor
2025-11-14 13:43 ` Thomas Weißschuh
2025-11-14 13:43 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 02/10] init: deduplicate cc-can-link.sh invocations Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-11-12 19:56 ` Nicolas Schier
2025-11-12 19:56 ` Nicolas Schier
2025-11-14 4:28 ` Nathan Chancellor
2025-11-14 4:28 ` Nathan Chancellor
2025-10-14 13:05 ` [PATCH v2 03/10] kbuild: allow architectures to override CC_CAN_LINK Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-11-12 19:56 ` Nicolas Schier [this message]
2025-11-12 19:56 ` Nicolas Schier
2025-11-13 9:22 ` Thomas Weißschuh
2025-11-13 9:22 ` Thomas Weißschuh
2025-11-14 4:31 ` Nathan Chancellor
2025-11-14 4:31 ` Nathan Chancellor
2025-10-14 13:05 ` [PATCH v2 04/10] riscv: Implement custom CC_CAN_LINK Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 05/10] s390: " Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 06/10] powerpc: " Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 07/10] MIPS: " Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 08/10] x86/Kconfig: " Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 09/10] sparc: " Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-10-14 13:05 ` [PATCH v2 10/10] kbuild: simplify CC_CAN_LINK Thomas Weißschuh
2025-10-14 13:05 ` Thomas Weißschuh
2025-11-12 19:56 ` Nicolas Schier
2025-11-12 19:56 ` Nicolas Schier
2025-11-12 20:03 ` [PATCH v2 00/10] kbuild: userprogs: introduce architecture-specific CC_CAN_LINK and userprog flags Nicolas Schier
2025-11-12 20:03 ` Nicolas Schier
2025-11-13 9:31 ` Thomas Weißschuh
2025-11-13 9:31 ` Thomas Weißschuh
2025-11-14 4:22 ` Nathan Chancellor
2025-11-14 4:22 ` Nathan Chancellor
2025-12-19 8:10 ` patchwork-bot+linux-riscv
2025-12-19 8:10 ` patchwork-bot+linux-riscv
2026-02-20 4:10 ` patchwork-bot+linux-riscv
2026-02-20 4:10 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRTmXJVXlbkF2rI4@derry.ads.avm.de \
--to=nsc@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=alex@ghiti.fr \
--cc=andreas@gaisler.com \
--cc=aou@eecs.berkeley.edu \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=christophe.leroy@csgroup.eu \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=masahiroy@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=nathan@kernel.org \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=sparclinux@vger.kernel.org \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=thomas.weissschuh@linutronix.de \
--cc=tsbogend@alpha.franken.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.