Skip to content

Commit 0da4bde

Browse files
authored
Rollup merge of rust-lang#50263 - alexcrichton:uwtable-allcoators, r=eddyb
rustc: Emit `uwtable` for allocator shims This commit emits the `uwtable` attribute to LLVM for platforms that require it for the allocator shims that we generate to ensure that they can hopefully get unwound past. This is a stab in the dark at helping https://bugzilla.mozilla.org/show_bug.cgi?id=1456150 along.
2 parents 1c1fd27 + 20ad427 commit 0da4bde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_trans/allocator.rs

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use std::ffi::CString;
1212
use std::ptr;
1313

14+
use attributes;
1415
use libc::c_uint;
1516
use rustc::middle::allocator::AllocatorKind;
1617
use rustc::ty::TyCtxt;
@@ -67,6 +68,9 @@ pub(crate) unsafe fn trans(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind)
6768
if tcx.sess.target.target.options.default_hidden_visibility {
6869
llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
6970
}
71+
if tcx.sess.target.target.options.requires_uwtable {
72+
attributes::emit_uwtable(llfn, true);
73+
}
7074

7175
let callee = CString::new(kind.fn_name(method.name)).unwrap();
7276
let callee = llvm::LLVMRustGetOrInsertFunction(llmod,

0 commit comments

Comments
 (0)