]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: move CFLAGS_{KASAN,UBSAN,KCSAN} exports to relevant Makefiles
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 10 Sep 2020 13:44:29 +0000 (22:44 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Thu, 24 Sep 2020 15:36:50 +0000 (00:36 +0900)
commit4e88cdaaa1743f4cc120e601173bda08eafd01b9
tree82ed0d438c401b482494e4b84457c714f27d7cc6
parent492d827ccffc8e5bc3f50ee0982ba41d7ebf4839
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>
Makefile
scripts/Makefile.kasan
scripts/Makefile.kcsan
scripts/Makefile.ubsan