Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference to wasmer_raise_trap when using native runtime #1928

Closed
kaimast opened this issue Dec 13, 2020 · 7 comments
Closed

Undefined reference to wasmer_raise_trap when using native runtime #1928

kaimast opened this issue Dec 13, 2020 · 7 comments
Labels
bug Something isn't working 📦 lib-engine-dylib About wasmer-engine-dylib

Comments

@kaimast
Copy link

kaimast commented Dec 13, 2020

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?

@kaimast kaimast added the bug Something isn't working label Dec 13, 2020
@MarkMcCaskey MarkMcCaskey added the 📦 lib-engine-dylib About wasmer-engine-dylib label Dec 14, 2020
@MarkMcCaskey
Copy link
Contributor

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.

@MarkMcCaskey
Copy link
Contributor

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.

@syrusakbary
Copy link
Member

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

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

@MarkMcCaskey
Copy link
Contributor

@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?

@kaimast
Copy link
Author

kaimast commented Dec 15, 2020

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!

@MarkMcCaskey
Copy link
Contributor

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.

@syrusakbary
Copy link
Member

This issue is a duplicate of #2107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-engine-dylib About wasmer-engine-dylib
Projects
None yet
3 participants