Skip to content

Commit 954cb15

Browse files
JamieCunliffefbq
authored andcommitted
arm64: rust: Enable PAC support for Rust.
Enable the PAC ret and BTI options in the Rust build flags to match the options that are used when building C. Signed-off-by: Jamie Cunliffe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 34fbe1d commit 954cb15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm64/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ endif
6767

6868
ifeq ($(CONFIG_ARM64_BTI_KERNEL),y)
6969
KBUILD_CFLAGS += -mbranch-protection=pac-ret+bti
70+
KBUILD_RUSTFLAGS += -Z branch-protection=bti,pac-ret
7071
else ifeq ($(CONFIG_ARM64_PTR_AUTH_KERNEL),y)
72+
KBUILD_RUSTFLAGS += -Z branch-protection=pac-ret
7173
ifeq ($(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET),y)
7274
KBUILD_CFLAGS += -mbranch-protection=pac-ret
7375
else

0 commit comments

Comments
 (0)