Skip to content

Rust 1.73 + emscripten 3.1.44 fails if using filesystem api #116655

Open
@selassje

Description

It builds fine with EMSDK 3.1.43.

use std::{fs::File, io::Read};

fn main() {
    let mut file = File::open("Hello world!").unwrap();
    let mut buf = Vec::new();
    file.read_to_end(&mut buf);
}

= 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:

rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-pc-windows-msvc
release: 1.73.0
LLVM version: 17.0.2
Backtrace

<backtrace>

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-emscriptenTarget: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions