|
|
Log in / Subscribe / Register

kbuild: userprogs: introduce architecture-specific CC_CAN_LINK and userprog flags

From:  Thomas Weißschuh <thomas.weissschuh-AT-linutronix.de>
To:  Nathan Chancellor <nathan-AT-kernel.org>, Nicolas Schier <nicolas.schier-AT-linux.dev>, Nicolas Schier <nsc-AT-kernel.org>, Paul Walmsley <pjw-AT-kernel.org>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Albert Ou <aou-AT-eecs.berkeley.edu>, Alexandre Ghiti <alex-AT-ghiti.fr>, Heiko Carstens <hca-AT-linux.ibm.com>, Vasily Gorbik <gor-AT-linux.ibm.com>, Alexander Gordeev <agordeev-AT-linux.ibm.com>, Christian Borntraeger <borntraeger-AT-linux.ibm.com>, Sven Schnelle <svens-AT-linux.ibm.com>, Madhavan Srinivasan <maddy-AT-linux.ibm.com>, Michael Ellerman <mpe-AT-ellerman.id.au>, Nicholas Piggin <npiggin-AT-gmail.com>, Christophe Leroy <christophe.leroy-AT-csgroup.eu>, Thomas Bogendoerfer <tsbogend-AT-alpha.franken.de>, Thomas Gleixner <tglx-AT-linutronix.de>, Ingo Molnar <mingo-AT-redhat.com>, Borislav Petkov <bp-AT-alien8.de>, Dave Hansen <dave.hansen-AT-linux.intel.com>, x86-AT-kernel.org, "H. Peter Anvin" <hpa-AT-zytor.com>, "David S. Miller" <davem-AT-davemloft.net>, Andreas Larsson <andreas-AT-gaisler.com>
Subject:  [PATCH v2 00/10] kbuild: userprogs: introduce architecture-specific CC_CAN_LINK and userprog flags
Date:  Tue, 14 Oct 2025 15:05:15 +0200
Message-ID:  <20251014-kbuild-userprogs-bits-v2-0-faeec46e887a@linutronix.de>
Cc:  linux-kbuild-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Masahiro Yamada <masahiroy-AT-kernel.org>, linux-riscv-AT-lists.infradead.org, linux-s390-AT-vger.kernel.org, linuxppc-dev-AT-lists.ozlabs.org, linux-mips-AT-vger.kernel.org, sparclinux-AT-vger.kernel.org, Thomas Weißschuh <thomas.weissschuh-AT-linutronix.de>
Archive-link:  Article

The current logic to inherit -m32/-m64 from the kernel build only works
for a few architectures. It does not handle byte order differences,
architectures using different compiler flags or different kinds of ABIs.

Introduce a per-architecture override mechanism to set CC_CAN_LINK and
the flags used for userprogs.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Changes in v2:
- Rebase and drop already applied patch
- Disable CC_CAN_LINK if the test program generates warnings
- Move to architecture-specific logic
- Link to v1: https://lore.kernel.org/r/20250813-kbuild-userprogs-bits-...

---
Thomas Weißschuh (10):
      kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings
      init: deduplicate cc-can-link.sh invocations
      kbuild: allow architectures to override CC_CAN_LINK
      riscv: Implement custom CC_CAN_LINK
      s390: Implement custom CC_CAN_LINK
      powerpc: Implement custom CC_CAN_LINK
      MIPS: Implement custom CC_CAN_LINK
      x86/Kconfig: Implement custom CC_CAN_LINK
      sparc: Implement custom CC_CAN_LINK
      kbuild: simplify CC_CAN_LINK

 Makefile                |  8 ++++++--
 arch/mips/Kconfig       | 15 +++++++++++++++
 arch/powerpc/Kconfig    | 15 +++++++++++++++
 arch/riscv/Kconfig      | 11 +++++++++++
 arch/s390/Kconfig       | 11 +++++++++++
 arch/sparc/Kconfig      | 11 +++++++++++
 arch/x86/Kconfig        | 11 +++++++++++
 init/Kconfig            |  7 +++++--
 scripts/Kconfig.include |  3 +++
 scripts/cc-can-link.sh  |  2 +-
 10 files changed, 89 insertions(+), 5 deletions(-)
---
base-commit: 10f8210c7a7098897fcee5ca70236167b39eb797
change-id: 20250813-kbuild-userprogs-bits-03c117da4d50

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds