vshymanskyy opened Issue #2878:
Steps to Reproduce
git clone https://github.com/wasm3/wasm3-self-compiling.git cd wasm3-self-compiling wasmtime run --mapdir=/::. --mapdir=./::. ./wasm/clang.wasm -- -cc1 -triple wasm32-unknown-wasi -isysroot /sys -internal-isystem /sys/include -emit-obj -o source/hello/hello.o source/hello/hello.c -O3
Expected Results
Compilation succeeds
Actual Results
Error: failed to run main module `./wasm/clang.wasm` Caused by: 0: failed to instantiate "./wasm/clang.wasm" 1: command export '_ZSt7nothrow' is not a function
Versions and Environment
Wasmtime version or commit: 0.26.0
Operating system: Ubuntu 21.04
Architecture: x86-64Extra Info
A similar command works with
Wasm3
,Wasmer
, Node.js (wasm-run
)
vshymanskyy labeled Issue #2878:
Steps to Reproduce
git clone https://github.com/wasm3/wasm3-self-compiling.git cd wasm3-self-compiling wasmtime run --mapdir=/::. --mapdir=./::. ./wasm/clang.wasm -- -cc1 -triple wasm32-unknown-wasi -isysroot /sys -internal-isystem /sys/include -emit-obj -o source/hello/hello.o source/hello/hello.c -O3
Expected Results
Compilation succeeds
Actual Results
Error: failed to run main module `./wasm/clang.wasm` Caused by: 0: failed to instantiate "./wasm/clang.wasm" 1: command export '_ZSt7nothrow' is not a function
Versions and Environment
Wasmtime version or commit: 0.26.0
Operating system: Ubuntu 21.04
Architecture: x86-64Extra Info
A similar command works with
Wasm3
,Wasmer
, Node.js (wasm-run
)
peterhuene commented on Issue #2878:
@sunfishcode the repro
clang.wasm
exports a bunch of globals that aren't expected for "commands" to export.Perhaps we should warn on or ignore non-function exports for commands (that we don't otherwise have a deprecation message for)?
tschneidereit commented on Issue #2878:
Is this the same issue as in #2587?
peterhuene commented on Issue #2878:
It appears to be.
peterhuene edited a comment on Issue #2878:
It appears to be and I think your proposed solution there is a good one.
vshymanskyy commented on Issue #2878:
Duplicate of #2587. Sorry didn't notice it!
vshymanskyy closed Issue #2878:
Steps to Reproduce
git clone https://github.com/wasm3/wasm3-self-compiling.git cd wasm3-self-compiling wasmtime run --mapdir=/::. --mapdir=./::. ./wasm/clang.wasm -- -cc1 -triple wasm32-unknown-wasi -isysroot /sys -internal-isystem /sys/include -emit-obj -o source/hello/hello.o source/hello/hello.c -O3
Expected Results
Compilation succeeds
Actual Results
Error: failed to run main module `./wasm/clang.wasm` Caused by: 0: failed to instantiate "./wasm/clang.wasm" 1: command export '_ZSt7nothrow' is not a function
Versions and Environment
Wasmtime version or commit: 0.26.0
Operating system: Ubuntu 21.04
Architecture: x86-64Extra Info
A similar command works with
Wasm3
,Wasmer
, Node.js (wasm-run
)
vshymanskyy edited a comment on Issue #2878:
Duplicate of #2587. Sorry didn't notice it!
Is there any workaround currently?
tschneidereit commented on Issue #2878:
No worries at all—thank you for the report!
Is there any workaround currently?
I don't think there is, I'm afraid :( I think the solution in the other bug shouldn't be too hard to implement, but I unfortunately don't have the bandwidth to do so right now :(
peterhuene commented on Issue #2878:
I have a fix ready that I'll put up a PR shortly for.
sunfishcode commented on Issue #2878:
@vshymanskyy Can you describe how you produced the wasm file? Workarounds are one thing, but I'm also curious if there's an underlying bug in clang or wasm-ld here. Are you using any special flags, like
--export-dynamic
?
vshymanskyy commented on Issue #2878:
@sunfishcode it was found in the wild: https://wapm.io/package/clang :grinning:
vshymanskyy edited a comment on Issue #2878:
@sunfishcode it was found in the wild: https://wapm.io/package/clang :grinning:
The files were produced by @binji : https://github.com/binji/llvm-project/releases
Last updated: Dec 23 2024 at 12:05 UTC