]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 24 Feb 2020 15:20:03 +0000 (16:20 +0100)
commit2592ff9515e7f035466da536af75214d390bd313
tree97457a6d28388ac22d3c11e674b430a076d8b152
parentad2fde22216b2a533739e3a1372a0ec3098cf2c3
kbuild: use -S instead of -E for precise cc-option test in Kconfig

BugLink: https://bugs.launchpad.net/bugs/1864488
[ 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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
scripts/Kconfig.include