x86/retpoline: Use -mfunction-return
[sfrench/cifs-2.6.git] / arch / x86 / Makefile
index a74886aed3495f29b356c3a0c63b3f6c1f8fa8f1..6e16057737e52883dd29212199383cf2320ed2d3 100644 (file)
@@ -15,11 +15,13 @@ endif
 ifdef CONFIG_CC_IS_GCC
 RETPOLINE_CFLAGS       := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
 RETPOLINE_CFLAGS       += $(call cc-option,-mindirect-branch-cs-prefix)
+RETPOLINE_CFLAGS       += $(call cc-option,-mfunction-return=thunk-extern)
 RETPOLINE_VDSO_CFLAGS  := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
 endif
 ifdef CONFIG_CC_IS_CLANG
 RETPOLINE_CFLAGS       := -mretpoline-external-thunk
 RETPOLINE_VDSO_CFLAGS  := -mretpoline
+RETPOLINE_CFLAGS       += $(call cc-option,-mfunction-return=thunk-extern)
 endif
 export RETPOLINE_CFLAGS
 export RETPOLINE_VDSO_CFLAGS