diff options
| author | James McGregor <james.mcgregor2@arm.com> | 2021-07-13 12:14:26 +0100 |
|---|---|---|
| committer | Jamie Cunliffe <Jamie.Cunliffe@arm.com> | 2021-12-01 12:24:30 +0000 |
| commit | 837cc1687f7c0d35a4e90a2f6bee377b5a2ecfd5 (patch) | |
| tree | 8ce2820cee2ce31a9b54e93791dd8a7b48241039 /compiler/rustc_codegen_llvm/src/declare.rs | |
| parent | 2446a215954a99f9d33019fad7d415ef9c083502 (diff) | |
| download | rust-837cc1687f7c0d35a4e90a2f6bee377b5a2ecfd5.tar.gz rust-837cc1687f7c0d35a4e90a2f6bee377b5a2ecfd5.zip | |
Add codegen option for branch protection and pointer authentication on AArch64
The branch-protection codegen option enables the use of hint-space pointer authentication code for AArch64 targets
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/declare.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/declare.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/declare.rs b/compiler/rustc_codegen_llvm/src/declare.rs index 8977fa085b9..f4e754b80c9 100644 --- a/compiler/rustc_codegen_llvm/src/declare.rs +++ b/compiler/rustc_codegen_llvm/src/declare.rs @@ -45,8 +45,13 @@ fn declare_raw_fn( llvm::Attribute::NoRedZone.apply_llfn(Function, llfn); } + if cx.tcx.sess.target.arch == "aarch64" { + attributes::set_branch_protection(cx.tcx.sess, llfn); + } + attributes::default_optimisation_attrs(cx.tcx.sess, llfn); attributes::non_lazy_bind(cx.sess(), llfn); + llfn } |
