Skip to content

Commit 6f49743

Browse files
nathanchanceAlexandre Ghiti
authored andcommitted
riscv: Require clang-17 or newer for kCFI
After the combination of commit c217157 ("riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS"), which starts using '-fpatchable-function-entry=M,N', and commit d0262e9 ("riscv: ftrace: support PREEMPT"), which allows CONFIG_DYNAMIC_FTRACE to be enabled by allmodconfig, allmodconfig builds with clang-16 begin crashing in the generic LLVM kCFI pass (see [1] for the stack trace). clang-17 avoids this crash by moving to target-specific lowering of the kCFI operand bundles [2]. Require clang-17 to select CONFIG_CFI_CLANG to avoid this crash. Fixes: c217157 ("riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS") Link: https://godbolt.org/z/xG39Pn16o [1] Link: llvm/llvm-project@62fa708 [2] Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Sami Tolvanen <[email protected]> Link: https://lore.kernel.org/r/20250612-riscv-require-clang-17-for-kcfi-v1-1-216f7cd7d87f@kernel.org Signed-off-by: Alexandre Ghiti <[email protected]>
1 parent d0b3b7b commit 6f49743

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/riscv/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ config RISCV
6363
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
6464
select ARCH_STACKWALK
6565
select ARCH_SUPPORTS_ATOMIC_RMW
66-
select ARCH_SUPPORTS_CFI_CLANG
66+
# clang >= 17: https://github.com/llvm/llvm-project/commit/62fa708ceb027713b386c7e0efda994f8bdc27e2
67+
select ARCH_SUPPORTS_CFI_CLANG if CLANG_VERSION >= 170000
6768
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
6869
select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
6970
select ARCH_SUPPORTS_HUGETLBFS if MMU

0 commit comments

Comments
 (0)