mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 05:38:19 +00:00
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:
4
Makefile
4
Makefile
@@ -55,10 +55,10 @@ bench:
|
|||||||
cargo bench $(compiler_features)
|
cargo bench $(compiler_features)
|
||||||
|
|
||||||
build-wasmer:
|
build-wasmer:
|
||||||
cargo build --release --manifest-path lib/cli/Cargo.toml $(compiler_features)
|
RUSTFLAGS="-C link-args=-Wl,-dynamic-list,$(pwd)/lib/engine-native/native.syms" cargo build --release --manifest-path lib/cli/Cargo.toml $(compiler_features)
|
||||||
|
|
||||||
build-wasmer-debug:
|
build-wasmer-debug:
|
||||||
cargo build --manifest-path lib/cli/Cargo.toml $(compiler_features)
|
RUSTFLAGS="-C link-args=-Wl,-dynamic-list,$(pwd)/lib/engine-native/native.syms" cargo build --manifest-path lib/cli/Cargo.toml $(compiler_features)
|
||||||
|
|
||||||
WAPM_VERSION = v0.5.0
|
WAPM_VERSION = v0.5.0
|
||||||
build-wapm:
|
build-wapm:
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ where
|
|||||||
{
|
{
|
||||||
// TODO: use perfect hash function?
|
// TODO: use perfect hash function?
|
||||||
let mut libcalls = HashMap::new();
|
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("truncf".to_string(), LibCall::TruncF32);
|
||||||
libcalls.insert("trunc".to_string(), LibCall::TruncF64);
|
libcalls.insert("trunc".to_string(), LibCall::TruncF64);
|
||||||
libcalls.insert("ceilf".to_string(), LibCall::CeilF32);
|
libcalls.insert("ceilf".to_string(), LibCall::CeilF32);
|
||||||
@@ -63,7 +63,7 @@ where
|
|||||||
libcalls.insert("floor".to_string(), LibCall::FloorF64);
|
libcalls.insert("floor".to_string(), LibCall::FloorF64);
|
||||||
libcalls.insert("nearbyintf".to_string(), LibCall::NearestF32);
|
libcalls.insert("nearbyintf".to_string(), LibCall::NearestF32);
|
||||||
libcalls.insert("nearbyint".to_string(), LibCall::NearestF64);
|
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 elf = goblin::elf::Elf::parse(&contents).map_err(map_goblin_err)?;
|
||||||
let get_section_name = |section: &goblin::elf::section_header::SectionHeader| {
|
let get_section_name = |section: &goblin::elf::section_header::SectionHeader| {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ impl<'ctx> Intrinsics<'ctx> {
|
|||||||
),
|
),
|
||||||
readonly: context
|
readonly: context
|
||||||
.create_enum_attribute(Attribute::get_named_enum_kind_id("readonly"), 0),
|
.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,
|
void_ty,
|
||||||
i1_ty,
|
i1_ty,
|
||||||
@@ -440,7 +440,7 @@ impl<'ctx> Intrinsics<'ctx> {
|
|||||||
|
|
||||||
// VM intrinsics.
|
// VM intrinsics.
|
||||||
throw_trap: module.add_function(
|
throw_trap: module.add_function(
|
||||||
"vm.exception.trap",
|
"wasmer_raise_trap",
|
||||||
void_ty.fn_type(&[i32_ty_basic], false),
|
void_ty.fn_type(&[i32_ty_basic], false),
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user