File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,15 @@ RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch-cs-prefix)
24
24
25
25
ifdef CONFIG_MITIGATION_RETHUNK
26
26
RETHUNK_CFLAGS := -mfunction-return=thunk-extern
27
+ RETHUNK_RUSTFLAGS := -Zfunction-return=thunk-extern
27
28
RETPOLINE_CFLAGS += $(RETHUNK_CFLAGS )
29
+ RETPOLINE_RUSTFLAGS += $(RETHUNK_RUSTFLAGS )
28
30
endif
29
31
30
32
export RETHUNK_CFLAGS
33
+ export RETHUNK_RUSTFLAGS
31
34
export RETPOLINE_CFLAGS
35
+ export RETPOLINE_RUSTFLAGS
32
36
export RETPOLINE_VDSO_CFLAGS
33
37
34
38
# For gcc stack alignment is specified with -mpreferred-stack-boundary,
@@ -218,6 +222,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
218
222
# Avoid indirect branches in kernel to deal with Spectre
219
223
ifdef CONFIG_MITIGATION_RETPOLINE
220
224
KBUILD_CFLAGS += $(RETPOLINE_CFLAGS )
225
+ KBUILD_RUSTFLAGS += $(RETPOLINE_RUSTFLAGS )
221
226
# Additionally, avoid generating expensive indirect jumps which
222
227
# are subject to retpolines for small number of switch cases.
223
228
# LLVM turns off jump table generation by default when under
You can’t perform that action at this time.
0 commit comments