Wasmer: Undefined reference to `wasmer_raise_trap` when using native runtime

Created on 14 Dec 2020  路  6Comments  路  Source: wasmerio/wasmer

Hi,

I have some wasm code that compiles and runs fine using llvm/jit but does not run with llvm/native. I get the following error.

thread 'main' panicked at 'Failed to compile wasm: Compile(Codegen("/tmp/wasmer_nativeLFymlg.so: undefined symbol: wasmer_raise_trap"))', src/main.rs:27:19

It looks like wasmer is not linking something correctly, or maybe I need to define these symbols?

馃悶 bug 馃摝 lib-engine-native

All 6 comments

Thanks for reporting the issue! Can you confirm which version of Wasmer you're using as well as what platform you're running on? Looks like Linux but it'd be good to confirm x86_64 or aarch64.

Also if possible, can you share the Wasm file or source code of the program compiled to Wasm that's triggering this? It's helpful to have all the pieces ready so that way we can definitely reproduce it when looking into it.

I can confirm that on wasmerio/wasmer master:

On aarch64 Linux Native + LLVM works fine in the following example ./target/release/wasmer run --native --llvm lib/c-api/tests/assets/qjs.wasm, however it does not work with Cranelift (get an error message about it not being supported).

It also works fine on x86_64 OSX, both LLVM and Cranelift.

This repo might be related (saw it over the weekend):

https://github.com/vlakreeh/reproduce-wasmer-cranelift-bug

@kaimast If you're using Wasmer as a library can you try adding https://github.com/wasmerio/wasmer/blob/master/.cargo/config.toml in .cargo/config.toml to your project and see if that fixes this?

I'm using the 1.0.0 beta from crates.io. And yes I am on x86_64 linux.

Adding the rustflag does indeed seem to fix it!

Glad to hear that!

We need to document this more clearly somewhere but I'm not exactly sure where...

We can close this issue with a PR adding documentation explaining this somewhere.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ensch picture ensch  路  5Comments

MaxGraey picture MaxGraey  路  3Comments

fd picture fd  路  3Comments

robinvanemden picture robinvanemden  路  4Comments

CuriousTommy picture CuriousTommy  路  4Comments