We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create an empty file test.rs and run
test.rs
rustc -C link-args='-s SIDE_MODULE' --target wasm32-unknown-emscripten --crate-type cdylib test.rs
It gives the error
error: linking with `emcc` failed: exit code: 1 | = note: "emcc" "-s" "DISABLE_EXCEPTION_CATCHING=0" "-L" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib" "-L" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/self-contained" "test.test.3a1fbbbh-cgu.0.rcgu.o" "-o" "test.wasm" "-s" "EXPORTED_FUNCTIONS=[\"_rust_eh_personality\"]" "test.2h4nzeicjcod1ad3.rcgu.o" "-O0" "--memory-init-file" "0" "-g0" "-s" "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]" "-L" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-d69e7237ec2ec907.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-cf6146279e321a86.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-30de99a0feadb118.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-744fdda8cec61518.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-1bd061abaa6299ee.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-790ede63273b678e.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-33e32972cf91da62.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-455b1f1bdddd2493.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-38821dae73c49cdd.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-f752c0f2f8e113a2.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-79c24dc82f9ff182.rlib" "/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-da221c4cef139dc0.rlib" "-l" "c" "-s" "SIDE_MODULE" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1" "-s" "ASSERTIONS=1" "-s" "ABORTING_MALLOC=0" "-Wl,--fatal-warnings" = note: wasm-ld: error: unknown file type: lib.rmeta emcc: error: '/opt/emscripten-llvm/bin/wasm-ld -o test.wasm --whole-archive -L/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib -L/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/self-contained test.test.3a1fbbbh-cgu.0.rcgu.o -L/usr/lib/emscripten/system/local/lib -L/usr/lib/emscripten/system/lib test.2h4nzeicjcod1ad3.rcgu.o -L/home/$USER/.emscripten_cache/wasm-pic -L/home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-d69e7237ec2ec907.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-cf6146279e321a86.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-30de99a0feadb118.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-744fdda8cec61518.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-1bd061abaa6299ee.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-790ede63273b678e.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-33e32972cf91da62.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-455b1f1bdddd2493.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-38821dae73c49cdd.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-f752c0f2f8e113a2.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-79c24dc82f9ff182.rlib /home/$USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-da221c4cef139dc0.rlib /home/$USER/.emscripten_cache/wasm-pic/libc.a --fatal-warnings --no-whole-archive -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined --import-memory --strip-debug --no-gc-sections --export-dynamic --export-all --experimental-pic -shared' failed (1)
The text was updated successfully, but these errors were encountered:
--whole-archive
As an update, the solution to this is to use -sSIDE_MODULE=2. If you also want everything to be exported, you could try -sSIDE_MODULE=2 -sEXPORT_ALL.
-sSIDE_MODULE=2
-sSIDE_MODULE=2 -sEXPORT_ALL
Sorry, something went wrong.
No branches or pull requests
Create an empty file
test.rs
and runIt gives the error
The text was updated successfully, but these errors were encountered: