kbuild: add -fcf-protection=none when using retpoline flags
authorSeth Forshee <seth.forshee@canonical.com>
Wed, 17 Jul 2019 16:06:26 +0000 (11:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Nov 2019 10:27:09 +0000 (11:27 +0100)
commitb17eae5a0e167e7fec32888f83d3a5dce85af1b4
treeb31fdb5b9e948e89c3909448d654251b28f21bd1
parent5ee93551c703f8fa1a6c414a7d08f956de311df3
kbuild: add -fcf-protection=none when using retpoline flags

[ Upstream commit 29be86d7f9cb18df4123f309ac7857570513e8bc ]

The gcc -fcf-protection=branch option is not compatible with
-mindirect-branch=thunk-extern. The latter is used when
CONFIG_RETPOLINE is selected, and this will fail to build with
a gcc which has -fcf-protection=branch enabled by default. Adding
-fcf-protection=none when building with retpoline enabled
prevents such build failures.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Makefile