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
This commit is contained in:
James McGregor
2021-07-13 12:14:26 +01:00
committed by Jamie Cunliffe
parent 2446a21595
commit 837cc1687f
12 changed files with 266 additions and 7 deletions

View File

@@ -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
}