From c2fe66981c03dceec5e546b72a66475832e0f5d1 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Tue, 31 Dec 2024 15:02:50 +0100 Subject: [PATCH] compiler,rust: No native-static-libs for wasm after 1.84 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] https://github.com/rust-lang/rust/pull/131533 [2] https://github.com/rust-lang/libc/pull/4002 --- mesonbuild/compilers/rust.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 717d5635f842..486be0900b16 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -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