]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: use -S instead of -E for precise cc-option test in Kconfig
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 17 Jan 2020 17:14:35 +0000 (02:14 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:54 +0000 (08:36 +0100)
commit398971728eeaf50a6879bdc16291ed00b48c56ed
tree52aec204fb11671f0446c5fb5d32b82171d928b4
parent6c80685bfa009eae441dde9af8478f8eafbafef8
kbuild: use -S instead of -E for precise cc-option test in Kconfig

[ Upstream commit b20bd77ab44f4fa2c7b45ef320d843d180e27b22 ]

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>
scripts/Kconfig.include