[PATCH] loongarch: Do not select HAVE_RUST when KASAN is enabled
From: Nathan Chancellor
Date: Thu Sep 03 2026 - 16:13:59 EST
After commit 2625480a1bf7 ("hardening: Default randstruct off with rust
for better allmodconfig support"), which allows Rust to be enabled for
allmodconfig, ARCH=loongarch allmodconfig starts failing with:
error: kernel-address sanitizer is not supported for this target
error: aborting due to 1 previous error
make[4]: *** [rust/Makefile:741: rust/core.o] Error 1
For the same reason as commit 84a0f7caafc6 ("ARM: Do not select
HAVE_RUST when KASAN is enabled"), do not select HAVE_RUST when KASAN is
enabled until the loongarch64-unknown-none-softfloat target in rustc
supports KASAN.
Fixes: 90868ff9cade ("LoongArch: Enable initial Rust support")
Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
---
arch/loongarch/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index a21f51e5815e..2067d1f2ad7a 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -175,7 +175,7 @@ config LOONGARCH
select HAVE_RELIABLE_STACKTRACE if UNWINDER_ORC
select HAVE_RETHOOK
select HAVE_RSEQ
- select HAVE_RUST
+ select HAVE_RUST if !KASAN
select HAVE_SAMPLE_FTRACE_DIRECT
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
select HAVE_SETUP_PER_CPU_AREA if NUMA
---
base-commit: 940de590b839f71d6dc846160534bf202401b8b7
change-id: 20260903-loongarch-disable-rust-with-kasan-ee6ca248bf1c
Best regards,
--
Cheers,
Nathan