summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-03-20 11:11:57 +0100
committerChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-04-27 08:28:29 +0200
commit5a0f312409eab96928a95598d440cf54b5cf7153 (patch)
treebc60c42c74c87a12b3f091a1c0369fe8d48e5f42 /arch/x86
parent15864540ddbda53071c5a85efaeccbee159836da (diff)
x86: Move x86-retpoline CFLAGS into x86 Makefile.
This patch moves the definition of RETPOLINE_CFLAGS* into the arch specific Makefile to allow other architectures to define their own retpoline CFLAGS. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 1c4d012550ec..33aab24c7b2c 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -239,6 +239,11 @@ KBUILD_CFLAGS += -Wno-sign-compare
#
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
+RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
+RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
+RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
+export RETPOLINE_CFLAGS
+
# Avoid indirect branches in kernel to deal with Spectre
ifdef CONFIG_RETPOLINE
ifneq ($(RETPOLINE_CFLAGS),)