Skip to content

"unknown file type lib.rmeta" when compiling rust with --target=wasm32-unknown-emscripten #16689

Closed
@hoodmane

Description

@hoodmane

xref #92738

When compiling rust as follows:

export RUSTFLAGS="-C link-arg=-s -C link-arg=SIDE_MODULE=1 -C relocation-model=pic -C target-feature=+mutable-globals"
cargo +nightly -Z build-std build --target=wasm32-unknown-emscripten

I get the error

wasm-ld: error: unknown file type: lib.rmeta

See #92738 for more details.

As a workaround, I've been applying the following patch:
pyodide/pyodide@cfafcda/emsdk/patches/0001-fix-up-rust-linker-errors.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions