summaryrefslogtreecommitdiff
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-05-15 18:37:28 +0200
commitbd87aeeb64e1612c41557cdd3756c5f90f86fff3 (patch)
tree3316ef28d10852c6afcd42ee44c67b5dd9971623
parent51803b4004e64ecba1e53ac766641934e32516e5 (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>
-rw-r--r--Makefile5
-rw-r--r--arch/x86/Makefile5
2 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index c1a608a1bc4c..837be9c15016 100644
--- a/Makefile
+++ b/Makefile
@@ -495,11 +495,6 @@ KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
endif
-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
-
# check for 'asm goto'
ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
CC_HAVE_ASM_GOTO := 1
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 60135cbd905c..7385122b4b70 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -242,6 +242,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),)