From fa606b1f45378bca9a782cd97859630d36b1dc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 27 Feb 2026 07:49:44 +0100 Subject: [PATCH] riscv: Implement ARCH_HAS_CC_CAN_LINK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generic CC_CAN_LINK detection relies on -m32/-m64 compiler flags. These are not supported by riscv compilers. Use architecture-specific logic using -mabi instead. Prefer the 'd' ABI variant when possible as todays toolchains are most likely to provide a libc for that one. Signed-off-by: Thomas Weißschuh Signed-off-by: Linux RISC-V bot --- arch/riscv/Kconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 90c531e6abf5cf..a9d111da37c2e2 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -25,6 +25,7 @@ config RISCV select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE select ARCH_HAS_BINFMT_FLAT + select ARCH_HAS_CC_CAN_LINK select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL if MMU select ARCH_HAS_DEBUG_VM_PGTABLE @@ -1374,6 +1375,20 @@ config PORTABLE config ARCH_PROC_KCORE_TEXT def_bool y +config ARCH_CC_CAN_LINK + bool + default $(cc_can_link_user,-mabi=lp64d) if 64BIT && FPU + default $(cc_can_link_user,-mabi=lp64) if 64BIT + default $(cc_can_link_user,-mabi=ilp32d) if FPU + default $(cc_can_link_user,-mabi=ilp32) + +config ARCH_USERFLAGS + string + default "-mabi=lp64d" if 64BIT && FPU + default "-mabi=lp64" if 64BIT + default "-mabi=ilp32d" if FPU + default "-mabi=ilp32" + menu "Power management options" source "kernel/power/Kconfig"