Skip to content

Commit

Permalink
compiler,rust: No native-static-libs for wasm after 1.84
Browse files Browse the repository at this point in the history
Rust 1.84 uses the latest emsdk 3.1.68 [1], and it fixed an
issue with Emscripten dynamic linking and libc [2]. After that no
native-static-libs in the output if running:

```
rustc --target=wasm32-unknown-emscripten --crate-type staticlib --print native-static-libs - < /dev/null
```

[1] rust-lang/rust#131533
[2] rust-lang/libc#4002
  • Loading branch information
rgonzalezfluendo committed Dec 31, 2024
1 parent 3b36cb2 commit c2fe669
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mesonbuild/compilers/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def _native_static_libs(self, work_dir: str, source_name: str) -> None:
# no match and kernel == none (i.e. baremetal) is a valid use case.
# return and let native_static_libs list empty
return
if self.info.system == 'emscripten':
# no match and emscripten is valid after rustc 1.84
return
raise EnvironmentException('Failed to find native-static-libs in Rust compiler output.')
# Exclude some well known libraries that we don't need because they
# are always part of C/C++ linkers. Rustc probably should not print
Expand Down

0 comments on commit c2fe669

Please sign in to comment.