Stream: ComponentizeJS

Topic: Linker errors with the latest StarlingMonkey


view this post on Zulip Daniel Vigovszky (May 24 2024 at 13:05):

Hi! I'm trying to build componentize-js using the latest StarlingMonkey (current main branch in the repo / our fork containing some initial attempts to fix fetch) and found that the following update of SpiderMonkey: https://github.com/bytecodealliance/StarlingMonkey/pull/41 introduced a linker issue that I could not figure out yet. After doing some minor changes on the componentize-js side (following the rust toolchain update and the change of run_event_loop, and updating to the latest StarlingMonkey version) seems like the build fails to link rust_encoding crate with the jsrust library (although I'm not sure I understand the issue properly):

wasm-ld: error: duplicate symbol: encoding_iso_2022_jp_ascii_valid_up_to
>>> defined in librust_encoding.a(rust_encoding-0b707846ea6b3289.rust_encoding.59ddf5d00e922ee8-cgu.0.rcgu.o)
>>> defined in /.../ComponentizeJS/StarlingMonkey/deps/cpm_cache/spidermonkey-release/0724b80a62196812717c8fbd9286c717d83c4113/spidermonkey-release/lib/libjsrust.a(jsrust-53a982b7a59e3f77.jsrust.86da07e83e4d91bd-cgu.0.rcgu.o)

wasm-ld: error: duplicate symbol: decoder_free
>>> defined in librust_encoding.a(rust_encoding-0b707846ea6b3289.rust_encoding.59ddf5d00e922ee8-cgu.0.rcgu.o)
>>> defined in /.../ComponentizeJS/StarlingMonkey/deps/cpm_cache/spidermonkey-release/0724b80a62196812717c8fbd9286c717d83c4113/spidermonkey-release/lib/libjsrust.a(jsrust-53a982b7a59e3f77.jsrust.86da07e83e4d91bd-cgu.0.rcgu.o)

....

Could you help me in what to try or where to look in order to try to fix this?

Updates to SpiderMonkey 124.0.2 per bytecodealliance/gecko-dev#43 and bytecodealliance/spidermonkey-wasi-embedding#11.

view this post on Zulip Guy Bedford (May 24 2024 at 17:10):

@Daniel Vigovszky that's because the rust toolchain version must match the one in StarlingMonkey here - https://github.com/bytecodealliance/StarlingMonkey/blob/main/rust-toolchain.toml. I'll see if I can get an update PR going as well.

The StarlingMonkey JS runtime. Contribute to bytecodealliance/StarlingMonkey development by creating an account on GitHub.

view this post on Zulip Guy Bedford (May 24 2024 at 17:45):

turns out this is an upstream issue - https://github.com/bytecodealliance/StarlingMonkey/issues/50

The release build is currently not working correctly. This may have happened in the latest SpiderMonkey update. Build error reported: [ 90%] Linking CXX executable starling.wasm wasm-ld: error: dup...

view this post on Zulip Daniel Vigovszky (May 24 2024 at 17:54):

This is how I tried to match the updated toolchain: https://github.com/golemcloud/ComponentizeJS/pull/1
but it leads to that linker error.

JS -> WebAssembly Component. Contribute to golemcloud/ComponentizeJS development by creating an account on GitHub.

Last updated: Nov 26 2024 at 00:12 UTC