Skip to content

Commit 39b25b3

Browse files
committed
Don't emit unwind tables on macOS
They don't work anyway as object misses support for emitting the particular format macOS expects. And on arm64 macOS it causes compilation to abort due to an unsupported relocation type. Fixes #1371
1 parent 0f1ee59 commit 39b25b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/debuginfo/unwind.rs

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ impl UnwindContext {
3838
}
3939

4040
pub(crate) fn add_function(&mut self, func_id: FuncId, context: &Context, isa: &dyn TargetIsa) {
41+
if let target_lexicon::OperatingSystem::MacOSX { .. } = isa.triple().operating_system {
42+
// The object crate doesn't currently support DW_GNU_EH_PE_absptr, which macOS
43+
// requires for unwinding tables. In addition on arm64 it currently doesn't
44+
// support 32bit relocations as we currently use for the unwinding table.
45+
// See gimli-rs/object#415 and rust-lang/rustc_codegen_cranelift#1371
46+
return;
47+
}
48+
4149
let unwind_info = if let Some(unwind_info) =
4250
context.compiled_code().unwrap().create_unwind_info(isa).unwrap()
4351
{

0 commit comments

Comments
 (0)