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

Singlepass v2 on ARM fails to compile #2777

Closed
syrusakbary opened this issue Feb 1, 2022 · 4 comments
Closed

Singlepass v2 on ARM fails to compile #2777

syrusakbary opened this issue Feb 1, 2022 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@syrusakbary
Copy link
Member

The program main.wasm which is a Go database (TiDB) is able to run on other compilers but when run with singlepass it outputs the following:

Download the file here: https://registry-cdn.wapm.io/contents/lucklove/tidb/0.1.6/main.wasm

$ wasmer run main.wasm --singlepass
thread '<unnamed>' panicked at 'singlepass can't emit LDR S64, Memory(X29, -104), Memory(X8, 0)', lib/compiler-singlepass/src/emitter_arm64.rs:382:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'singlepass can't emit LDR S64, Memory(X29, -72), Memory(X8, 0)', lib/compiler-singlepass/src/emitter_arm64.rs:382:18
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ImpossibleRelocation(Dynamic(DynamicLabel(2)))', lib/compiler-singlepass/src/machine_arm64.rs:1891:35
@syrusakbary syrusakbary added the bug Something isn't working label Feb 1, 2022
@syrusakbary syrusakbary added this to the v2.x milestone Feb 1, 2022
ptitSeb added a commit that referenced this issue Feb 1, 2022
…ond_label_far as direct bcond may not work all the time (for #2777)
bors bot added a commit that referenced this issue Feb 7, 2022
2778: Fix Singlepass f32_load and f64_load function, and introduce emit_bond_label_far as direct bcond may not work all the time (for #2777) r=Amanieu a=ptitSeb

# Description
Aarch64 singlepass fix for #2777 :
* Change implementation of f32_load and f64_load to be more flexible
* Instroduce the `emit_bcond_label_far` emitter to alow use of bcond on "farther" reloc. It does slow down a little bit (like less than 5% on less powerfull devices), but it's cecessary to be able to run larger wasm file. Also, beeing "singlepass", no real smart way alay to detect if a "far" version is needed or not (so "far" are used everywhere).

Co-authored-by: ptitSeb <[email protected]>
@ptitSeb
Copy link
Contributor

ptitSeb commented Feb 10, 2022

@syrusakbary we can close the ticket now, right?

@ptitSeb ptitSeb closed this as completed Feb 16, 2022
@orangeC23
Copy link

I tried to reproduce it, but only singlepass can successfully execute, both cranelift and llvm was blocked and print nothing .

@ptitSeb
Copy link
Contributor

ptitSeb commented Jul 14, 2022

You need to be patient, it may take a long time for the other compiler to build this one.

I suggest you read this blog entry: https://wasmer.io/posts/wasmer-2.2 at the end, there are some compile benchmark.

@orangeC23
Copy link

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants