-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
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
Rust 1.73 + emscripten 3.1.44 fails if using filesystem api #116655
Comments
Compatibility with Emscripten 3.1.44 and 3.1.45 is addressed in PR rust-lang/libc#3308, which is included in libc 0.2.149. This should be available in (the upcoming) Rust 1.75.0 (see #116527). |
I don't think newer emscripten fixed this, or if it was fixed it regressed again. I have emscripten 3.1.48 and the reproducer from the original report above still fails to link with the same undefined symbols. Building with rustc 1.75 (I tried 1.75.0-beta.5) does work, though. |
Just to add that using
|
Indeed, I can confirm that it's still broken on the latest stable version of Rust in combination with Emscripten 3.1.44 or higher. I've updated my previous comment. Details$ curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --target wasm32-unknown-emscripten
$ source "$HOME/.cargo/env"
$ rustc --version --verbose
rustc 1.74.1 (a28077b28 2023-12-04)
binary: rustc
commit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1
commit-date: 2023-12-04
host: x86_64-unknown-linux-gnu
release: 1.74.1
LLVM version: 17.0.4
$ emcc -dumpversion
3.1.51
$ cat <<EOT > main.rs
use std::{fs::File, io::Read};
fn main() {
let mut file = File::open("Hello world!").unwrap();
let mut buf = Vec::new();
let _ = file.read_to_end(&mut buf);
}
EOT
$ rustc main.rs --target wasm32-unknown-emscripten
error: linking with `emcc` failed: exit status: 1
... This is curious, as the above mentioned Emscripten PR is supposed to fix that, at least for C/C++ programs. |
It builds fine with EMSDK 3.1.43.
= note: wasm-ld: error: C:\Users\Przemyslaw.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\wasm32-unknown-emscripten\lib\libstd-330edb0856239641.rlib(std-330edb0856239641.std.fa9f9c7c191d43dc-cgu.0.rcgu.o): undefined symbol: open64
wasm-ld: error: C:\Users\Przemyslaw.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\wasm32-unknown-emscripten\lib\libstd-330edb0856239641.rlib(std-330edb0856239641.std.fa9f9c7c191d43dc-cgu.0.rcgu.o): undefined symbol: fstat64
wasm-ld: error: C:\Users\Przemyslaw.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\wasm32-unknown-emscripten\lib\libstd-330edb0856239641.rlib(std-330edb0856239641.std.fa9f9c7c191d43dc-cgu.0.rcgu.o): undefined symbol: lseek64
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: