]> 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)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 22 Jan 2020 02:04:28 +0000 (11:04 +0900)
commit437c5c0495a5632c651c399c17690d660f50cc53
tree4b73fc5ee26959c9fce6745f06baaeba594dcc3f
parentad28d9d8bdc6615fbe5d9cef116200ae9a6a611e
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>
scripts/Kconfig.include