Skip to content

WASI cdylib output #2703

Open
Open
@nhynes

Description

@nhynes

Currently wasm32-wasi does not support the cdylib output type, which is unfortunate because this means that only Rust programs can consume programs that target wasi (through the rlib output).

As a motivating example, consider a database wrapper Wasm module. One might want to write it safely in Rust and use it from another Wasm module loaded at runtime. The database wrapper would want to use WASI syscalls to access the database process. This is not yet possible because Rust WASI modules cannot be made into cdylibs.

It looks like all that would need to be done to support this feature is to not link crt1 when compiling to cdylib. This would amount to creating a target that looks like wasm32-unknown-unknown except with wasi sys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageProposals relating to the linking step.A-targetTarget related proposals & ideasT-compilerRelevant to the compiler team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions