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>
This commit is contained in:
parent
6ceafb880c
commit
6e54abac1b
1 changed files with 6 additions and 2 deletions
|
@ -13,12 +13,16 @@ CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \
|
||||||
--param asan-instrumentation-with-call-threshold=$(call_threshold))
|
--param asan-instrumentation-with-call-threshold=$(call_threshold))
|
||||||
|
|
||||||
ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),)
|
ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),)
|
||||||
|
ifneq ($(CONFIG_COMPILE_TEST),y)
|
||||||
$(warning Cannot use CONFIG_KASAN: \
|
$(warning Cannot use CONFIG_KASAN: \
|
||||||
-fsanitize=kernel-address is not supported by compiler)
|
-fsanitize=kernel-address is not supported by compiler)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
ifeq ($(CFLAGS_KASAN),)
|
ifeq ($(CFLAGS_KASAN),)
|
||||||
$(warning CONFIG_KASAN: compiler does not support all options.\
|
ifneq ($(CONFIG_COMPILE_TEST),y)
|
||||||
Trying minimal configuration)
|
$(warning CONFIG_KASAN: compiler does not support all options.\
|
||||||
|
Trying minimal configuration)
|
||||||
|
endif
|
||||||
CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
|
CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue