Merge tag 'for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen19...
[linux-block.git] / lib / Kconfig.kasan
index be6ee60202908394540f68bf7ff4b25f296cf78d..fdca89c057452e7715a21316a1d3b763a525d785 100644 (file)
@@ -49,6 +49,15 @@ menuconfig KASAN
 
 if KASAN
 
+config CC_HAS_KASAN_MEMINTRINSIC_PREFIX
+       def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=kernel-address -mllvm -asan-kernel-mem-intrinsic-prefix=1)) || \
+                (CC_IS_GCC && $(cc-option,-fsanitize=kernel-address --param asan-kernel-mem-intrinsic-prefix=1))
+       # Don't define it if we don't need it: compilation of the test uses
+       # this variable to decide how the compiler should treat builtins.
+       depends on !KASAN_HW_TAGS
+       help
+         The compiler is able to prefix memintrinsics with __asan or __hwasan.
+
 choice
        prompt "KASAN mode"
        default KASAN_GENERIC