diff options
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 511755200634..044eb4f89a91 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -119,6 +119,16 @@ _c_flags += $(if $(patsubst n%,, \ | |||
119 | $(CFLAGS_GCOV)) | 119 | $(CFLAGS_GCOV)) |
120 | endif | 120 | endif |
121 | 121 | ||
122 | # | ||
123 | # Enable address sanitizer flags for kernel except some files or directories | ||
124 | # we don't want to check (depends on variables KASAN_SANITIZE_obj.o, KASAN_SANITIZE) | ||
125 | # | ||
126 | ifeq ($(CONFIG_KASAN),y) | ||
127 | _c_flags += $(if $(patsubst n%,, \ | ||
128 | $(KASAN_SANITIZE_$(basetarget).o)$(KASAN_SANITIZE)y), \ | ||
129 | $(CFLAGS_KASAN)) | ||
130 | endif | ||
131 | |||
122 | # If building the kernel in a separate objtree expand all occurrences | 132 | # If building the kernel in a separate objtree expand all occurrences |
123 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). | 133 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). |
124 | 134 | ||