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:25:39 +0000 (11:25 +0100)
commit2103cc67dbfbcfc5c5838d4d0859631e9f3dfce3
tree32aa172c0738231e8371e53afa41c9c92ed40456
parentb125188db9b12a3d6f7fc7d3a66929f2ffae7872
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