Skip to content

Commit 5b27154

Browse files
Darksonnojeda
authored andcommitted
rust: kasan: KASAN+RUST requires clang
Kernel KASAN involves passing various llvm/gcc specific arguments to the C and Rust compiler. Since these arguments differ between llvm and gcc, it's not safe to mix an llvm-based rustc with a gcc build when kasan is enabled. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Cc: stable@vger.kernel.org Fixes: e311740 ("kbuild: rust: Enable KASAN support") Link: https://patch.msgid.link/20260408-kasan-rust-sw-tags-v3-1-e07964d14363@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent a960c2c commit 5b27154

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

init/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,7 @@ config RUST
21982198
depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
21992199
depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
22002200
select CFI_ICALL_NORMALIZE_INTEGERS if CFI
2201+
depends on !KASAN || CC_IS_CLANG
22012202
depends on !KASAN_SW_TAGS
22022203
help
22032204
Enables Rust support in the kernel.

0 commit comments

Comments
 (0)