Skip to content

Commit 6e54aba

Browse files
aryabinintorvalds
authored andcommitted
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>
1 parent 6ceafb8 commit 6e54aba

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎scripts/Makefile.kasan‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \
1313
--param asan-instrumentation-with-call-threshold=$(call_threshold))
1414

1515
ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),)
16+
ifneq ($(CONFIG_COMPILE_TEST),y)
1617
$(warning Cannot use CONFIG_KASAN: \
1718
-fsanitize=kernel-address is not supported by compiler)
19+
endif
1820
else
1921
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
2226
CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
2327
endif
2428
endif

0 commit comments

Comments
 (0)