All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: Implement ARCH_HAS_CC_CAN_LINK
@ 2025-12-22  8:28 Thomas Weißschuh
  2025-12-22 11:28 ` Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2025-12-22  8:28 UTC (permalink / raw)
  To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle
  Cc: linux-s390, linux-kernel, Thomas Weißschuh

The generic CC_CAN_LINK detection relies on -m32/-m64 compiler flags.
s390 toolchains use -m31 instead but that is not supported in the
kernel.

Make the logic easier to understand and allow the simplification of the
generic CC_CAN_LINK by using a tailored implementation.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 arch/s390/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 0e5fad5f06ca..cd856318ffe5 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -85,6 +85,7 @@ config S390
 	select ARCH_ENABLE_MEMORY_HOTREMOVE
 	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
 	select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
+	select ARCH_HAS_CC_CAN_LINK
 	select ARCH_HAS_CPU_FINALIZE_INIT
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_HAS_DEBUG_VIRTUAL
@@ -294,6 +295,14 @@ config PGTABLE_LEVELS
 
 source "kernel/livepatch/Kconfig"
 
+config ARCH_CC_CAN_LINK
+	bool
+	default $(cc_can_link_user,-m64)
+
+config ARCH_USERFLAGS
+	string
+	default "-m64"
+
 config ARCH_SUPPORTS_KEXEC
 	def_bool y
 

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cc-can-link-s390-223eca6ac085

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] s390: Implement ARCH_HAS_CC_CAN_LINK
  2025-12-22  8:28 [PATCH] s390: Implement ARCH_HAS_CC_CAN_LINK Thomas Weißschuh
@ 2025-12-22 11:28 ` Heiko Carstens
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2025-12-22 11:28 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, linux-s390, linux-kernel

On Mon, Dec 22, 2025 at 09:28:17AM +0100, Thomas Weißschuh wrote:
> The generic CC_CAN_LINK detection relies on -m32/-m64 compiler flags.
> s390 toolchains use -m31 instead but that is not supported in the
> kernel.

Some s390 toolchains default to -m31, depending on how they are
built. Actually I'm only aware of a single one. But given that this
one is used all over the place for cross builds it is important
enough.

> Make the logic easier to understand and allow the simplification of the
> generic CC_CAN_LINK by using a tailored implementation.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>  arch/s390/Kconfig | 9 +++++++++
>  1 file changed, 9 insertions(+)

Applied, and scheduled for the next merge window. Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-22 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22  8:28 [PATCH] s390: Implement ARCH_HAS_CC_CAN_LINK Thomas Weißschuh
2025-12-22 11:28 ` Heiko Carstens

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.