summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2023-07-25 14:05:48 -0400
committer Ivan Lozano <ivanlozano@google.com> 2023-07-25 14:25:43 -0400
commit2797e876f154c4ec0d9fe5a5d19633a5be3e0901 (patch)
treecbebd6bc29d8d54f653b2a1eb631726522f649f9
parentf7bd2592a1b6ec932ce9cac81f0e1ec66e938b94 (diff)
rust: Add BTI/PAC for supported targets.
This mirrors the support provided for cc modules. Bug: 181027427 Test: m rust Change-Id: I1354b37ec8c47132f143400adba6d42cf2081df5
-rw-r--r--rust/config/arm64_device.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/rust/config/arm64_device.go b/rust/config/arm64_device.go
index ae783e8dd..08ac2ef7d 100644
--- a/rust/config/arm64_device.go
+++ b/rust/config/arm64_device.go
@@ -26,11 +26,18 @@ var (
Arm64LinkFlags = []string{}
Arm64ArchVariantRustFlags = map[string][]string{
- "armv8-a": []string{},
- "armv8-a-branchprot": []string{},
- "armv8-2a": []string{},
- "armv8-2a-dotprod": []string{},
- "armv9-a": []string{},
+ "armv8-a": []string{},
+ "armv8-a-branchprot": []string{
+ // branch-protection=bti,pac-ret is equivalent to Clang's mbranch-protection=standard
+ "-Z branch-protection=bti,pac-ret",
+ },
+ "armv8-2a": []string{},
+ "armv8-2a-dotprod": []string{},
+ "armv9-a": []string{
+ // branch-protection=bti,pac-ret is equivalent to Clang's mbranch-protection=standard
+ "-Z branch-protection=bti,pac-ret",
+ "-Z stack-protector=none",
+ },
}
)