kbuild: dummy-tools: adjust to stricter stackprotector check

commit c93db682cf upstream.

Commit 3fb0fdb3bb ("x86/stackprotector/32: Make the canary into a regular
percpu variable") modified the stackprotector check on 32-bit x86 to check
if gcc supports using %fs as canary. Adjust dummy-tools gcc script to pass
this new test by returning "%fs" rather than "%gs" if it detects
-mstack-protector-guard-reg=fs on command line.

Fixes: 3fb0fdb3bb ("x86/stackprotector/32: Make the canary into a regular percpu variable")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Michal Kubecek 2021-05-15 12:11:13 +02:00 committed by Greg Kroah-Hartman
parent 682f6ca967
commit 44900a8bec
1 changed files with 5 additions and 1 deletions

View File

@ -76,7 +76,11 @@ fi
if arg_contain -S "$@"; then
# For scripts/gcc-x86-*-has-stack-protector.sh
if arg_contain -fstack-protector "$@"; then
echo "%gs"
if arg_contain -mstack-protector-guard-reg=fs "$@"; then
echo "%fs"
else
echo "%gs"
fi
exit 0
fi
fi