Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kasan: Makefile: shut up warnings if CONFIG_COMPILE_TEST=y

It might be annoying to constantly see this:

scripts/Makefile.kasan:16: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler

while performing allmodconfig/allyesconfig build tests.
Disable this warning if CONFIG_COMPILE_TEST=y.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrey Ryabinin and committed by
Linus Torvalds
6e54abac 6ceafb88

+6 -2
+6 -2
scripts/Makefile.kasan
··· 13 13 --param asan-instrumentation-with-call-threshold=$(call_threshold)) 14 14 15 15 ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) 16 + ifneq ($(CONFIG_COMPILE_TEST),y) 16 17 $(warning Cannot use CONFIG_KASAN: \ 17 18 -fsanitize=kernel-address is not supported by compiler) 19 + endif 18 20 else 19 21 ifeq ($(CFLAGS_KASAN),) 20 - $(warning CONFIG_KASAN: compiler does not support all options.\ 21 - Trying minimal configuration) 22 + ifneq ($(CONFIG_COMPILE_TEST),y) 23 + $(warning CONFIG_KASAN: compiler does not support all options.\ 24 + Trying minimal configuration) 25 + endif 22 26 CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) 23 27 endif 24 28 endif