[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251222-cc-can-link-mips-v1-1-6d87a8afe442@linutronix.de>
Date: Mon, 22 Dec 2025 09:28:47 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH] MIPS: Implement ARCH_HAS_CC_CAN_LINK
The generic CC_CAN_LINK detection does not handle different byte orders.
This may lead to userprogs which are not actually runnable on the target
kernel.
Use architecture-specific logic supporting byte orders instead.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
arch/mips/Kconfig | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b88b97139fa8..316e3c29c431 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -4,6 +4,7 @@ config MIPS
default y
select ARCH_32BIT_OFF_T if !64BIT
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
+ select ARCH_HAS_CC_CAN_LINK
select ARCH_HAS_CPU_CACHE_ALIASING
select ARCH_HAS_CPU_FINALIZE_INIT
select ARCH_HAS_CURRENT_STACK_POINTER
@@ -3126,6 +3127,20 @@ config CC_HAS_MNO_BRANCH_LIKELY
config CC_HAS_BROKEN_INLINE_COMPAT_BRANCH
def_bool y if CC_IS_CLANG
+config ARCH_CC_CAN_LINK
+ bool
+ default $(cc_can_link_user,-m64 -EL) if 64BIT && CPU_LITTLE_ENDIAN
+ default $(cc_can_link_user,-m64 -EB) if 64BIT && CPU_BIG_ENDIAN
+ default $(cc_can_link_user,-m32 -EL) if CPU_LITTLE_ENDIAN
+ default $(cc_can_link_user,-m32 -EB) if CPU_BIG_ENDIAN
+
+config ARCH_USERFLAGS
+ string
+ default "-m64 -EL" if 64BIT && CPU_LITTLE_ENDIAN
+ default "-m64 -EB" if 64BIT && CPU_BIG_ENDIAN
+ default "-m32 -EL" if CPU_LITTLE_ENDIAN
+ default "-m32 -EB" if CPU_BIG_ENDIAN
+
menu "Power management options"
config ARCH_HIBERNATION_POSSIBLE
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251222-cc-can-link-mips-c9c0e06b61f7
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Powered by blists - more mailing lists