kbuild: include scripts/Makefile.* only when relevant CONFIG is enabled
Currently, the top Makefile includes all of scripts/Makefile.<feature> even if the associated CONFIG option is disabled. Do not include unneeded Makefiles in order to slightly optimize the parse stage. Include $(include-y), and ignore $(include-). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
ifdef CONFIG_KCOV
|
||||
|
||||
kcov-flags-$(CONFIG_CC_HAS_SANCOV_TRACE_PC) += -fsanitize-coverage=trace-pc
|
||||
kcov-flags-$(CONFIG_KCOV_ENABLE_COMPARISONS) += -fsanitize-coverage=trace-cmp
|
||||
kcov-flags-$(CONFIG_GCC_PLUGIN_SANCOV) += -fplugin=$(objtree)/scripts/gcc-plugins/sancov_plugin.so
|
||||
|
||||
export CFLAGS_KCOV := $(kcov-flags-y)
|
||||
|
||||
endif
|
||||
|
@@ -1,6 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ifdef CONFIG_KCSAN
|
||||
|
||||
# GCC and Clang accept backend options differently. Do not wrap in cc-option,
|
||||
# because Clang accepts "--param" even if it is unused.
|
||||
ifdef CONFIG_CC_IS_CLANG
|
||||
@@ -15,5 +13,3 @@ CFLAGS_KCSAN := -fsanitize=thread \
|
||||
$(call cc-option,$(call cc-param,tsan-instrument-func-entry-exit=0) -fno-optimize-sibling-calls) \
|
||||
$(call cc-option,$(call cc-param,tsan-instrument-read-before-write=1)) \
|
||||
$(call cc-param,tsan-distinguish-volatile=1)
|
||||
|
||||
endif # CONFIG_KCSAN
|
||||
|
@@ -1,6 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ifdef CONFIG_UBSAN
|
||||
|
||||
ifdef CONFIG_UBSAN_ALIGNMENT
|
||||
CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment)
|
||||
endif
|
||||
@@ -26,4 +24,3 @@ endif
|
||||
# -fsanitize=* options makes GCC less smart than usual and
|
||||
# increase number of 'maybe-uninitialized false-positives
|
||||
CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized)
|
||||
endif
|
||||
|
Reference in New Issue
Block a user