Skip to content
New issue

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

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

Already on GitHub? # to your account

Executable produced by create-exe with --llvm switch is malformed #5287

Open
marcinbugaj opened this issue Dec 6, 2024 · 1 comment
Open
Assignees

Comments

@marcinbugaj
Copy link

marcinbugaj commented Dec 6, 2024

Describe the bug

I tried to create a native binary from cowsay example. It does not work when --llvm switch is passed.

Version:

marcin@marcin-thinkpad:~/projects/cowsay$ wasmer -vV; rustc -vV
wasmer 5.0.2 (f910351 2024-11-22)
binary: wasmer-cli
commit-hash: f910351560663f43920e0bc52549190c7c82aac9
commit-date: 2024-11-22
host: x86_64-unknown-linux-gnu
compiler: singlepass,cranelift,llvm
c_api backend: 
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1

On ubuntu 22.04. Wasmer installed according to instructions

Steps to reproduce

Note that because of #5281 I'm using --target switch

git clone git@github.com:wapm-packages/cowsay.git
cd cowsay
rustup target add wasm32-wasi
cargo build --release --target wasm32-wasi
wasmer create-exe  --llvm --tarball=./wasmer-linux-amd64.tar.gz -o cowsay.exe target/wasm32-wasi/release/cowsay.wasm
Compiler: llvm
Target: x86_64-unknown-linux-gnu
Using path `/home/marcin/projects/cowsay/wasmer-linux-amd64/lib/libwasmer-headless.a` as libwasmer path.
✔ Native executable compiled successfully to `cowsay.exe`.

When run:

marcin@marcin-thinkpad:~/projects/cowsay$ ./cowsay.exe asdf
Failed to create module from atom "cowsay"
Error len: `65`
incompatible binary: The provided bytes are not wasmer-universal

Additional context

If --cranelift switch is passed instead of --llvm then the program runs in a correct way.

@xdoardo
Copy link
Contributor

xdoardo commented Dec 12, 2024

Thanks! I'll investigate this.
(Note to self: these two are probably linked: #5301)

@xdoardo xdoardo self-assigned this Dec 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants