emscripten-core / emscripten-core/emscripten

Linking empty rust file fails with "unable to find library -lc-debug"

Open
#17,191 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 6h
Merged PRs (30d)
109

Description

The following:
```sh
touch file.rs
rustc file.rs --target wasm32-unknown-emscripten -C link-arg=-sSIDE_MODULE=1 --crate-type cdylib
```
Results in
`wasm-ld: error: unable to find library -lc-debug`.
Rust always includes `-sASSERTIONS=1` in the linker args, see https://github.com/rust-lang/rust/pull/97928/.

This seems to be a regression between emscripten version 2.0.27 and version 3.1.6. If I surgically set `settings.ASSERTIONS=0`, then it still fails with "unable to find library -lc". I don't think it should be trying to link `-lc` anyways because I am trying to make a side module. But I am not sure what the proper setting is to convince Rust or Emscripten to discard this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.