]> git.baikalelectronics.ru Git - kernel.git/commit
stack-protector: test compiler capability in Kconfig and drop AUTO mode
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 May 2018 09:22:00 +0000 (18:22 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 8 Jun 2018 09:56:00 +0000 (18:56 +0900)
commitee2502342771ff0a9adcb1508241071cafd348ff
tree497f971a5b6af6085c8d2349e773045f6a88dcc1
parentdb53fbf257ebf094deddc54607b5430ba9fc3053
stack-protector: test compiler capability in Kconfig and drop AUTO mode

Move the test for -fstack-protector(-strong) option to Kconfig.

If the compiler does not support the option, the corresponding menu
is automatically hidden.  If STRONG is not supported, it will fall
back to REGULAR.  If REGULAR is not supported, it will be disabled.
This means, AUTO is implicitly handled by the dependency solver of
Kconfig, hence removed.

I also turned the 'choice' into only two boolean symbols.  The use of
'choice' is not a good idea here, because all of all{yes,mod,no}config
would choose the first visible value, while we want allnoconfig to
disable as many features as possible.

X86 has additional shell scripts in case the compiler supports those
options, but generates broken code.  I added CC_HAS_SANE_STACKPROTECTOR
to test this.  I had to add -m32 to gcc-x86_32-has-stack-protector.sh
to make it work correctly.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Kees Cook <keescook@chromium.org>
Makefile
arch/Kconfig
arch/x86/Kconfig
scripts/gcc-x86_32-has-stack-protector.sh
scripts/gcc-x86_64-has-stack-protector.sh