[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251014-kbuild-userprogs-bits-v2-10-faeec46e887a@linutronix.de>
Date: Tue, 14 Oct 2025 15:05:25 +0200
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nicolas.schier@...ux.dev>, Nicolas Schier <nsc@...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>
Cc: 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,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH v2 10/10] kbuild: simplify CC_CAN_LINK
All architectures supporting multiple ABIs have been migrated to
ARCH_CC_CAN_LINK. The remaining ones do not require any special flag,
so simplify the logic.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
Makefile | 11 +++--------
init/Kconfig | 3 +--
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 26e5bca534e27034c355939bca4c90db435ecdbd..1b7da9f10b88f1a374ae34477e5621b4dd27c017 100644
--- a/Makefile
+++ b/Makefile
@@ -1137,17 +1137,12 @@ endif
# Align the architecture of userspace programs with the kernel
USERFLAGS_FROM_KERNEL := --target=%
-ifdef CONFIG_ARCH_USERPROGS_CFLAGS
-KBUILD_USERCFLAGS += $(CONFIG_ARCH_USERFLAGS)
-KBUILD_USERLDFLAGS += $(CONFIG_ARCH_USERFLAGS)
-else
-# If not overridden also inherit the bit size
-USERFLAGS_FROM_KERNEL += -m32 -m64
-endif
-
KBUILD_USERCFLAGS += $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
KBUILD_USERLDFLAGS += $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
+KBUILD_USERCFLAGS += $(CONFIG_ARCH_USERFLAGS)
+KBUILD_USERLDFLAGS += $(CONFIG_ARCH_USERFLAGS)
+
# userspace programs are linked via the compiler, use the correct linker
ifdef CONFIG_CC_IS_CLANG
KBUILD_USERLDFLAGS += --ld-path=$(LD)
diff --git a/init/Kconfig b/init/Kconfig
index 4a2ae3cfbf26525a60936d9b29a74ef4319ba3a5..a0127598f2f25ffb55dbb8a0691b0aa68138fc69 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -88,8 +88,7 @@ config ARCH_HAS_CC_CAN_LINK
config CC_CAN_LINK
bool
default ARCH_CC_CAN_LINK if ARCH_HAS_CC_CAN_LINK
- default $(cc_can_link_user,$(m64-flag)) if 64BIT
- default $(cc_can_link_user,$(m32-flag))
+ default $(cc_can_link_user)
# Fixed in GCC 14, 13.3, 12.4 and 11.5
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
--
2.51.0
Powered by blists - more mailing lists