Open syrusakbary opened 4 years ago
Looks like it is trying to read the dylink
custom section, and erroring out because it's missing that field. @sbc100 looks like you added this, do you know what may be happening?
Thanks, I'll take a look.
Hmm, what version of llvm was used to compile that file? It looks like that I added the extrea leb to that section back in https://reviews.llvm.org/D55613, which I think means it was in llvm 8 and above.
My guess is that other validators ignore this section completely, and I guess maybe(?) wasm-validate should too?
Also, I don't think wasm32-unknown-unknown
should be producing dynamic libraries should it? Does it even support the -shared
flag?
Hmm, what version of llvm was used to compile that file?
Unfortunately we don't have the script that we used to generate the file, so we can't know for sure. It could be that was the rustc version we were using was using llvm-7?
Yes I think wasm-ld from llvm 7 would produce such a dylink section, but even then only if linked as a shared library with -shared
or -pie
I believe.
Either way we should re-visit how we validate this custom section.
While working on an issue in Wasmer, we realized that wabt was unable to parse/validate a valid Wasm file, failing with a
needed_dynlibs
error (my local wabt was installed via homebrew).The
hello_wasm.wasm
file seem to be valid according to other validators, so we have no insight of what might be causing the parsing/validating error.For debugging: the wasm file was generated using rustc with
wasm32-unknown-unknown
target for this source: https://github.com/wasmerio/wasmer/blob/master/lib/runtime-c-api/tests/assets/return_hello.rs