Also stop emitting BTI prologues for naked functions

Same idea but for AArch64.
This commit is contained in:
Jubilee Young 2022-07-06 19:09:33 -07:00
parent 92174f988b
commit 530b5da49b
2 changed files with 23 additions and 0 deletions

View file

@ -303,6 +303,8 @@ pub fn from_fn_attrs<'ll, 'tcx>(
// And it is a module-level attribute, so the alternative is pulling naked functions into new LLVM modules.
// Otherwise LLVM's "naked" functions come with endbr prefixes per https://github.com/rust-lang/rust/issues/98768
to_add.push(AttributeKind::NoCfCheck.create_attr(cx.llcx));
// Need this for AArch64.
to_add.push(llvm::CreateAttrStringValue(cx.llcx, "branch-target-enforcement", "false"));
}
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
// apply to return place instead of function (unlike all other attributes applied in this function)