]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: simplify `RUSTC_VERSION` Kconfig conditions
authorMiguel Ojeda <ojeda@kernel.org>
Sun, 5 Apr 2026 23:52:44 +0000 (01:52 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 7 Apr 2026 08:00:23 +0000 (10:00 +0200)
With the Rust version bump in place, several Kconfig conditions based on
`RUSTC_VERSION` are always true.

Thus simplify them.

The minimum supported major LLVM version by our new Rust minimum version
is now LLVM 18, instead of LLVM 16. However, there are no possible
cleanups for `RUSTC_LLVM_VERSION`.

Reviewed-by: Tamir Duberstein <tamird@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260405235309.418950-9-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
arch/Kconfig
arch/arm64/Kconfig
arch/riscv/Kconfig
init/Kconfig

index 102ddbd4298efa6246b430f8fe23c8884a6b9454..84089e80584b0febd635598a13c8e2f4d5d7e1c9 100644 (file)
@@ -968,10 +968,9 @@ config HAVE_CFI_ICALL_NORMALIZE_INTEGERS
 config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
        def_bool y
        depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
-       depends on RUSTC_VERSION >= 107900
        depends on ARM64 || X86_64
        # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
-       depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
+       depends on RUSTC_LLVM_VERSION >= 190103 || \
                (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
 
 config CFI_PERMISSIVE
index 38dba5f7e4d2d7e6d2ea4ef696578b5dae8d1192..c91130c7fba108b543485d023396ad542ddb33af 100644 (file)
@@ -291,14 +291,6 @@ config ARM64
 config RUSTC_SUPPORTS_ARM64
        def_bool y
        depends on CPU_LITTLE_ENDIAN
-       # Shadow call stack is only supported on certain rustc versions.
-       #
-       # When using the UNWIND_PATCH_PAC_INTO_SCS option, rustc version 1.80+ is
-       # required due to use of the -Zfixed-x18 flag.
-       #
-       # Otherwise, rustc version 1.82+ is required due to use of the
-       # -Zsanitizer=shadow-call-stack flag.
-       depends on !SHADOW_CALL_STACK || RUSTC_VERSION >= 108200 || RUSTC_VERSION >= 108000 && UNWIND_PATCH_PAC_INTO_SCS
 
 config CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS
        def_bool CC_IS_CLANG
index 90c531e6abf5cf63355615a4536d63d08d764e48..ddc534402400d6a9595810707b9b42dbf0824e82 100644 (file)
@@ -232,9 +232,6 @@ config RISCV
 config RUSTC_SUPPORTS_RISCV
        def_bool y
        depends on 64BIT
-       # Shadow call stack requires rustc version 1.82+ due to use of the
-       # -Zsanitizer=shadow-call-stack flag.
-       depends on !SHADOW_CALL_STACK || RUSTC_VERSION >= 108200
 
 config CLANG_SUPPORTS_DYNAMIC_FTRACE
        def_bool CC_IS_CLANG
index 36d32ea445942814f5576a78097621ad6c16f950..b8a1ab0d49d41f8d32a90bf50bcc5a058c79e9ca 100644 (file)
@@ -2193,9 +2193,7 @@ config RUST
        depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
        depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
        select CFI_ICALL_NORMALIZE_INTEGERS if CFI
-       depends on !CALL_PADDING || RUSTC_VERSION >= 108100
        depends on !KASAN_SW_TAGS
-       depends on !(MITIGATION_RETHUNK && KASAN) || RUSTC_VERSION >= 108300
        help
          Enables Rust support in the kernel.