diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-09-29 11:32:06 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 12:48:05 +0200 |
commit | 32c2a4de7191a59df7777c29e814fe0d0a735d85 (patch) | |
tree | 4221cedc5f6f9ea11edc43d4739bd38e6424d19a /arch/x86/Makefile | |
parent | 2d76dd0e177b564a99385c03732e1424d84c281b (diff) | |
download | linux-stable-32c2a4de7191a59df7777c29e814fe0d0a735d85.tar.gz linux-stable-32c2a4de7191a59df7777c29e814fe0d0a735d85.tar.bz2 linux-stable-32c2a4de7191a59df7777c29e814fe0d0a735d85.zip |
x86/retpolines: Fix up backport of a9d57ef15cbe
Commit a9d57ef15cbe ("x86/retpolines: Disable switch jump tables when
retpolines are enabled") added -fno-jump-tables to workaround a GCC issue
while deliberately avoiding adding this flag when CONFIG_CC_IS_CLANG is
set, which is defined by the kconfig system when CC=clang is provided.
However, this symbol was added in 4.18 in commit 469cb7376c06 ("kconfig:
add CC_IS_CLANG and CLANG_VERSION") so it is always undefined in 4.14,
meaning -fno-jump-tables gets added when using Clang.
Fix this up by using the equivalent $(cc-name) comparison, which matches
what upstream did until commit 076f421da5d4 ("kbuild: replace cc-name
test with CONFIG_CC_IS_CLANG").
Fixes: e28951100515 ("x86/retpolines: Disable switch jump tables when retpolines are enabled")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/Makefile')
-rw-r--r-- | arch/x86/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index cd596ca60901..3dc54d2f79c4 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -249,7 +249,7 @@ ifdef CONFIG_RETPOLINE # retpoline builds, however, gcc does not for x86. This has # only been fixed starting from gcc stable version 8.4.0 and # onwards, but not for older ones. See gcc bug #86952. - ifndef CONFIG_CC_IS_CLANG + ifneq ($(cc-name), clang) KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables) endif endif |