summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-01-18 02:14:35 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-24 08:34:50 +0100
commit4feefb5cd5859dfcd9e4ce1e6dd7265052c2da04 (patch)
treebf41005dd5bb0e93cbd4093b7d1b7372da128e7b /scripts
parentafdf4de910986e50567c92b9e4ff901606013978 (diff)
downloadlinux-stable-4feefb5cd5859dfcd9e4ce1e6dd7265052c2da04.tar.gz
linux-stable-4feefb5cd5859dfcd9e4ce1e6dd7265052c2da04.tar.bz2
linux-stable-4feefb5cd5859dfcd9e4ce1e6dd7265052c2da04.zip
kbuild: use -S instead of -E for precise cc-option test in Kconfig
[ Upstream commit 3bed1b7b9d79ca40e41e3af130931a3225e951a3 ] Currently, -E (stop after the preprocessing stage) is used to check whether the given compiler flag is supported. While it is faster than -S (or -c), it can be false-positive. You need to run the compilation proper to check the flag more precisely. For example, -E and -S disagree about the support of "--param asan-instrument-allocas=1". $ gcc -Werror --param asan-instrument-allocas=1 -E -x c /dev/null -o /dev/null $ echo $? 0 $ gcc -Werror --param asan-instrument-allocas=1 -S -x c /dev/null -o /dev/null cc1: error: invalid --param name ‘asan-instrument-allocas’; did you mean ‘asan-instrument-writes’? $ echo $? 1 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kconfig.include2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index 3b2861f47709..79455ad6b386 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -20,7 +20,7 @@ success = $(if-success,$(1),y,n)
# $(cc-option,<flag>)
# Return y if the compiler supports <flag>, n otherwise
-cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /dev/null)
+cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null)
# $(ld-option,<flag>)
# Return y if the linker supports <flag>, n otherwise