hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/riscv/Kconfig
....@@ -22,6 +22,7 @@
2222 select ARCH_HAS_GIGANTIC_PAGE
2323 select ARCH_HAS_KCOV
2424 select ARCH_HAS_MMIOWB
25
+ select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
2526 select ARCH_HAS_PTE_SPECIAL
2627 select ARCH_HAS_SET_DIRECT_MAP
2728 select ARCH_HAS_SET_MEMORY
....@@ -331,6 +332,28 @@
331332
332333 endmenu
333334
335
+config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
336
+ def_bool y
337
+ # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc
338
+ depends on AS_IS_GNU && AS_VERSION >= 23800
339
+ help
340
+ Newer binutils versions default to ISA spec version 20191213 which
341
+ moves some instructions from the I extension to the Zicsr and Zifencei
342
+ extensions.
343
+
344
+config TOOLCHAIN_NEEDS_OLD_ISA_SPEC
345
+ def_bool y
346
+ depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
347
+ # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
348
+ depends on CC_IS_CLANG && CLANG_VERSION < 170000
349
+ help
350
+ Certain versions of clang do not support zicsr and zifencei via -march
351
+ but newer versions of binutils require it for the reasons noted in the
352
+ help text of CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. This
353
+ option causes an older ISA spec compatible with these older versions
354
+ of clang to be passed to GAS, which has the same result as passing zicsr
355
+ and zifencei to -march.
356
+
334357 config FPU
335358 bool "FPU support"
336359 default y