summaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2024-08-20 22:48:58 +0300
committerMiguel Ojeda <ojeda@kernel.org>2024-09-16 19:04:37 +0300
commite3117404b41124c88a4d834fc3222669a880addc (patch)
tree8be4fff78e5090b51adec601b8b4b267541f173c /scripts/Makefile.lib
parentf64e2f3a66e30319023b7924d438d159ac742d63 (diff)
downloadlinux-e3117404b41124c88a4d834fc3222669a880addc.tar.xz
kbuild: rust: Enable KASAN support
Rust supports KASAN via LLVM, but prior to this patch, the flags aren't set properly. Suggested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Matthew Maurer <mmaurer@google.com> Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com> Link: https://lore.kernel.org/r/20240820194910.187826-4-mmaurer@google.com [ Applied "SW_TAGS KASAN" nit. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index fe3668dc4954..27999da3d382 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -167,6 +167,9 @@ ifneq ($(CONFIG_KASAN_HW_TAGS),y)
_c_flags += $(if $(patsubst n%,, \
$(KASAN_SANITIZE_$(target-stem).o)$(KASAN_SANITIZE)$(is-kernel-object)), \
$(CFLAGS_KASAN), $(CFLAGS_KASAN_NOSANITIZE))
+_rust_flags += $(if $(patsubst n%,, \
+ $(KASAN_SANITIZE_$(target-stem).o)$(KASAN_SANITIZE)$(is-kernel-object)), \
+ $(RUSTFLAGS_KASAN))
endif
endif