-
Notifications
You must be signed in to change notification settings - Fork 725
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
0000099: error: unable to read u32 leb128: stack pointer index #838
Comments
I chatted with @sbc100 about this, and we're wondering if you're using an older version of wabt. The newest versions should be expecting a linking metadata version which is likely provided by the generated wasm file. |
$ which wasm2wat (~/src/wabt is the github repo, and it's up-to-date [last commit May 14]) |
I can take a look at this one. |
Looks like then new version field is not being added to the linking metadata. It was recently added so its not surprising. Also, the issue was being mis-reported due to a bug: #841. Oops. After that change land the error message is more useful:
|
Thanks for looking into this. |
@sbc100 wrote the wasm implementation of LLD so I imagine he will fix it. I did think of another thing to change in wabt though; currently |
I suspect that the compiler that generated that object file just needs to be updated to a version that writes the newer metadata format. Do you know how that object was generated? By which llvm version exactly? I don't think |
I generated the object like this: My Rust nightly-2018-05-09 uses LLVM 6. Tracking issue: I note that there is a tracking issue to upgrade Rust to use LLVM 7: I also note the changelog for LLVM 7 contains a number of wasm-related LLD enhancements. |
That sounds right to me. |
Cool. I'll close this - I can reopen later if necessary. |
I'm compiling Rust code to wasm, and I'm getting the leb128 issue with wasm-validate.
Rust code:
#[no_mangle]
pub extern "C" fn test(n: i32) -> i32 {
n
}
I'm using the latest wabt master branch as of today, and a Rust May 9, 2018 nightly.
$ cargo build --release --target wasm32-unknown-unknown
$ wasm-validate target/wasm32-unknown-unknown/release/test.wasm
Has LLVM perhaps been updated to use a different format? Maybe wabt is expecting an older format?
The text was updated successfully, but these errors were encountered: