summaryrefslogtreecommitdiff
path: root/scripts/Kconfig.include
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-01-17 20:14:35 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2020-01-22 05:04:28 +0300
commit3bed1b7b9d79ca40e41e3af130931a3225e951a3 (patch)
tree4b73fc5ee26959c9fce6745f06baaeba594dcc3f /scripts/Kconfig.include
parent1a7f0a34ea7d05d1ffcd32c9b1b4e07ac0687538 (diff)
downloadlinux-3bed1b7b9d79ca40e41e3af130931a3225e951a3.tar.xz
kbuild: use -S instead of -E for precise cc-option test in Kconfig
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>
Diffstat (limited to 'scripts/Kconfig.include')
-rw-r--r--scripts/Kconfig.include2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index d4adfbe42690..bfb44b265a94 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -25,7 +25,7 @@ failure = $(if-success,$(1),n,y)
# $(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