diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-09-10 22:44:29 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2020-09-25 00:36:50 +0900 |
commit | bb2732112bc52bed7b20b9fc59d7246e4e7ce5ed (patch) | |
tree | 82ed0d438c401b482494e4b84457c714f27d7cc6 /scripts/Makefile.kasan | |
parent | 9909b7681222299dcb6f3b0613c30a65498b6c72 (diff) | |
download | linux-bb2732112bc52bed7b20b9fc59d7246e4e7ce5ed.tar.gz linux-bb2732112bc52bed7b20b9fc59d7246e4e7ce5ed.tar.bz2 linux-bb2732112bc52bed7b20b9fc59d7246e4e7ce5ed.zip |
kbuild: move CFLAGS_{KASAN,UBSAN,KCSAN} exports to relevant Makefiles
Move CFLAGS_KASAN*, CFLAGS_UBSAN, CFLAGS_KCSAN to Makefile.kasan,
Makefile.ubsan, Makefile.kcsan, respectively.
This commit also avoids the same -fsanitize=* flags being added to
CFLAGS_UBSAN multiple times.
Prior to this commit, the ubsan flags were appended by the '+='
operator, without any initialization. Some build targets such as
'make bindeb-pkg' recurses to the top Makefile, and ended up with
adding the same flags to CFLAGS_UBSAN twice.
Clear CFLAGS_UBSAN with ':=' to make it a simply expanded variable.
This is better than a recursively expanded variable, which evaluates
$(call cc-option, ...) multiple times before Kbuild starts descending
to subdirectories.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Marco Elver <elver@google.com>
Diffstat (limited to 'scripts/Makefile.kasan')
-rw-r--r-- | scripts/Makefile.kasan | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 1532f1a41a8f..1e000cc2e7b4 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -47,3 +47,5 @@ CFLAGS_KASAN := -fsanitize=kernel-hwaddress \ $(instrumentation_flags) endif # CONFIG_KASAN_SW_TAGS + +export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE |