Skip to content

Emscripten dynamic linking and libc #98155

Closed
@hoodmane

Description

@hoodmane

When dynamically linking Emscripten modules, Rust passes -lc to Emscripten. This causes wasm-ld: error: unable to find library -lc-debug. I see that -lc is coming via EmLinker.link_dylib. If I make link_dylib into a no-op this fixes the problem, though maybe that has other bad side effects. I am not sure how to filter out libraries that shouldn't be statically linked into a dynamic library. But it would be great to fix this. I am currently using an emcc linker wrapper that deletes the -lc argument.

@sbc100
xref emscripten-core/emscripten#17191

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-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-compilerRelevant to the compiler 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