You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust libraries contain a lib.rmeta file and must be linked with --no-whole-archive. When I try to build rust libraries targeting wasm32-unknown-emscripten I run into linker errors because the rust libraries are being loaded with --whole-archive set.
I think that emscripten is indeed the culprit here:
# Emscripten currently expects linkable output (SIDE_MODULE/MAIN_MODULE) to# include all archive contents.ifsettings.LINKABLE:
args.insert(0, '--whole-archive')
args.append('--no-whole-archive')
We probably need a separate setting to disable this.
Response file with problematic linker args
root:WARNING: Creating response file /tmp/emscripten_w2dsyqtv.rsp with following contents: -o
/src/packages/cryptography/build/cryptography-36.0.2/src/rust/target/wasm32-unknown-emscripten/release/deps/cryptography_rust.wasm
--whole-archive
<... tons of files, some of which require --no-whole-archive>
-lc
-L/src/.docker_home/.rustup/toolchains/nightly-2022-05-28-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib
-L/src/.docker_home/.rustup/toolchains/nightly-2022-05-28-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/self-contained
--fatal-warnings
-L/src/emsdk/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic
--no-whole-archive
-mllvm
-combiner-global-alias-analysis=false
-mllvm
-enable-emscripten-cxx-exceptions
-mllvm
-enable-emscripten-sjlj
-mllvm
-disable-lsr
--import-undefined
--import-memory
--strip-debug
--export-all
--no-gc-sections
--experimental-pic
-shared
The text was updated successfully, but these errors were encountered:
I wonder if we can/should just remove this block... folks could always add it back themselves if they really wanted to force all symbols from libraries
Continuing the discussion from llvm/llvm-project#55786 xref rust-lang/rust#80775, xref pyodide/pyodide#2378.
Rust libraries contain a
lib.rmeta
file and must be linked with--no-whole-archive
. When I try to build rust libraries targetingwasm32-unknown-emscripten
I run into linker errors because the rust libraries are being loaded with--whole-archive
set.I think that emscripten is indeed the culprit here:
emscripten/tools/building.py
Line 363 in 2aa89c2
We probably need a separate setting to disable this.
Response file with problematic linker args
The text was updated successfully, but these errors were encountered: