Open jieyouxu opened 3 weeks ago
Apparently needs-dynamic-linking is not equivalent to checking if dylib or cdylib crate types are supported.
needs-dynamic-linking
dynamic_linking
--print=cfg --target $TARGET
only_cdylib
true
cdylib
dylib
wasm
Originally posted by @jieyouxu in https://github.com/rust-lang/rust/issues/130860#issuecomment-2376713633
Related: #132350
Apparently
needs-dynamic-linking
is not equivalent to checking if dylib or cdylib crate types are supported.needs-dynamic-linking
performs a check based on target cfg'sdynamic_linking
field +--print=cfg --target $TARGET
.only_cdylib
which, ifdynamic_linking
istrue
, indicates that onlycdylib
crate type is supported and notdylib
. https://github.com/rust-lang/rust/blob/f2becdff0496003217e7fc6fbfcaf2640e162775/compiler/rustc_target/src/spec/mod.rs#L2148-L2153wasm
base, dynamic linking is supported but notdylib
crate type, onlycdylib
is supported. https://github.com/rust-lang/rust/blob/f2becdff0496003217e7fc6fbfcaf2640e162775/compiler/rustc_target/src/spec/base/wasm.rs#L58-L62Originally posted by @jieyouxu in https://github.com/rust-lang/rust/issues/130860#issuecomment-2376713633