wasmerio/wasmer · error
dwarf relocation size for LSDA not supported: {}
Error message
dwarf relocation size for LSDA not supported: {} What it means
Same DWARF writer as error 190, but for the LSDA (Language Specific Data Area) symbol: when writing an .eh_frame pointer to an LSDA target, only Abs4/Abs8 relocations are implemented; any other size panics with unimplemented!().
Source
Thrown at lib/compiler-cranelift/src/dwarf.rs:120
8 => RelocationKind::Abs8,
other => unimplemented!(
"dwarf relocation size for personality not supported: {}",
other
),
};
self.relocs.push(Relocation {
kind,
reloc_target: RelocationTarget::LibCall(LibCall::EHPersonality),
offset,
addend,
});
self.write_udata(0, size)
} else if let Some((target, base)) = self.lsda_symbols.get(&symbol) {
let offset = self.len() as u32;
let kind = match size {
4 => RelocationKind::Abs4,
8 => RelocationKind::Abs8,
other => unimplemented!(
"dwarf relocation size for LSDA not supported: {}",
other
),
};
self.relocs.push(Relocation {
kind,
reloc_target: *target,
offset,
addend: *base as i64 + addend,
});
self.write_udata(0, size)
} else {
unreachable!("Symbol {} in DWARF not recognized", symbol);
}
}
}
}
View on GitHub (pinned to 8c4b9ee9d3)
Solutions
- Update Wasmer to a newer release
- Use a mainstream target (x86_64/aarch64) where 4/8-byte LSDA pointers are standard
- Disable wasm exception handling or unwind-info generation in the compile pipeline
- Switch to the LLVM compiler backend which has fuller DWARF support
Example fix
// before
let kind = match size {
4 => RelocationKind::Abs4,
8 => RelocationKind::Abs8,
other => unimplemented!("dwarf relocation size for LSDA not supported: {}", other),
};
// after
let kind = match size {
4 => RelocationKind::Abs4,
8 => RelocationKind::Abs8,
other => return Err(CompileError::Codegen(format!("unsupported LSDA reloc size: {}", other))),
}; Defensive patterns
Strategy: validation
Validate before calling
// Guard: only attempt LSDA-emitting EH compilation on 64-bit mainstream targets let arch = target.triple().architecture; assert!(matches!(arch, Architecture::X86_64 | Architecture::Aarch64(_)), "cranelift LSDA reloc only supports 4/8-byte sizes");
Type guard
fn is_supported_lsda_size(size: u8) -> bool { size == 4 || size == 8 } Prevention
- Avoid wasm-EH modules with cranelift on non-mainstream targets
- Prefer the LLVM backend when DWARF/EH fidelity matters
- Keep the compiler updated
- Validate target triples before engine creation
When it happens
Trigger: Writing .eh_frame LSDA pointers during cranelift compilation of modules with exception handling, when the requested relocation size is not 4 or 8 bytes.
Common situations: Compiling wasm-EH modules on unusual targets; experimental DWARF encodings with non-standard pointer sizes; building custom targets where the eh-frame writer requests smaller/larger widths.
Related errors
- dwarf relocation size for personality not supported: {}
- eh pointer encoding {eh_pe:?} not supported for symbol targe
- write_offset not yet implemented
- write_offset_at not yet implemented
- dwarf relocation size not yet supported: {}
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/8dedd656db2e95ac.
Report an issue: GitHub.