Temporarily fix wasmtime on aarch64 by not constructing per-inst address map. (#1541)

The current build of wasmtime on aarch64 panics immediately because the
debug infrastructure constructs an address-to-instruction map
unconditionally now, and the new backend does not yet support debug info
generally (#1523). In this particular case, the address-map construction
consults the encoding info, which is not implemented by the new backend
and causes the panic.

This fix simply avoids generating per-instruction entries in the address
map; it at least gets us going until we plumb SourceLocs all the way
through the new pipeline.
This commit is contained in:
Chris Fallin
2020-04-17 13:37:05 -07:00
committed by GitHub
parent 3159f0a76e
commit 73fddc3f8d

View File

@@ -125,15 +125,19 @@ fn get_function_address_map<'data>(
let mut blocks = func.layout.blocks().collect::<Vec<_>>(); let mut blocks = func.layout.blocks().collect::<Vec<_>>();
blocks.sort_by_key(|block| func.offsets[*block]); // Ensure inst offsets always increase blocks.sort_by_key(|block| func.offsets[*block]); // Ensure inst offsets always increase
let encinfo = isa.encoding_info(); // FIXME(#1523): New backend does not support debug info or instruction-address mapping
for block in blocks { // yet.
for (offset, inst, size) in func.inst_offsets(block, &encinfo) { if !isa.get_mach_backend().is_some() {
let srcloc = func.srclocs[inst]; let encinfo = isa.encoding_info();
instructions.push(InstructionAddressMap { for block in blocks {
srcloc, for (offset, inst, size) in func.inst_offsets(block, &encinfo) {
code_offset: offset as usize, let srcloc = func.srclocs[inst];
code_len: size as usize, instructions.push(InstructionAddressMap {
}); srcloc,
code_offset: offset as usize,
code_len: size as usize,
});
}
} }
} }