Use wasmer_raise_trap and wasmer_probestack in compiler-llvm.

As a linux-only temporary hack, export those two symbols from the wasmer binary.

Note: is a bit of a hack and works on linux only.
This commit is contained in:
Nick Lewycky
2020-08-06 12:12:17 -07:00
parent 2c2da8ec3c
commit ed878db40d
3 changed files with 6 additions and 6 deletions

View File

@@ -54,7 +54,7 @@ where
{
// TODO: use perfect hash function?
let mut libcalls = HashMap::new();
libcalls.insert("vm.exception.trap".to_string(), LibCall::RaiseTrap);
libcalls.insert("wasmer_raise_trap".to_string(), LibCall::RaiseTrap);
libcalls.insert("truncf".to_string(), LibCall::TruncF32);
libcalls.insert("trunc".to_string(), LibCall::TruncF64);
libcalls.insert("ceilf".to_string(), LibCall::CeilF32);
@@ -63,7 +63,7 @@ where
libcalls.insert("floor".to_string(), LibCall::FloorF64);
libcalls.insert("nearbyintf".to_string(), LibCall::NearestF32);
libcalls.insert("nearbyint".to_string(), LibCall::NearestF64);
libcalls.insert("vm.probestack".to_string(), LibCall::Probestack);
libcalls.insert("wasmer_probestack".to_string(), LibCall::Probestack);
let elf = goblin::elf::Elf::parse(&contents).map_err(map_goblin_err)?;
let get_section_name = |section: &goblin::elf::section_header::SectionHeader| {

View File

@@ -370,7 +370,7 @@ impl<'ctx> Intrinsics<'ctx> {
),
readonly: context
.create_enum_attribute(Attribute::get_named_enum_kind_id("readonly"), 0),
stack_probe: context.create_string_attribute("probe-stack", "vm.probestack"),
stack_probe: context.create_string_attribute("probe-stack", "wasmer_probestack"),
void_ty,
i1_ty,
@@ -440,7 +440,7 @@ impl<'ctx> Intrinsics<'ctx> {
// VM intrinsics.
throw_trap: module.add_function(
"vm.exception.trap",
"wasmer_raise_trap",
void_ty.fn_type(&[i32_ty_basic], false),
None,
),