Skip to content

Commit bb9d3be

Browse files
committed
rustc: Allow the cdylib crate type with wasm32-wasi
The wasm32-wasi target respects configuration around `crt-static` in general, but is defaulted to being static. This interacted badly with code which validated the `cdylib` crate type for `wasm32-wasi`, erroneously saying that the `cdylib` crate type wasn't supported on `wasm32-wasi` by default. This commit sets the appropriate flag in `wasm32_wasi`'s target specification to indicate that the `cdylib` crate type is supported regardless of `crt-static` Closes #64187
1 parent 6187684 commit bb9d3be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_target/spec/wasm32_wasi.rs

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ pub fn target() -> Result<Target, String> {
9797
options.crt_static_default = true;
9898
options.crt_static_respected = true;
9999

100+
// Allow `+crt-static` to create a "cdylib" output which is just a wasm file
101+
// without a main function.
102+
options.crt_static_allows_dylibs = true;
103+
100104
Ok(Target {
101105
llvm_target: "wasm32-wasi".to_string(),
102106
target_endian: "little".to_string(),

0 commit comments

Comments
 (0)