Closed
Description
Apparently needs-dynamic-linking
is not equivalent to checking if dylib or cdylib crate types are supported.
- In compiletest,
needs-dynamic-linking
performs a check based on target cfg'sdynamic_linking
field +--print=cfg --target $TARGET
. - However, target cfg has an additional field
only_cdylib
which, ifdynamic_linking
istrue
, indicates that onlycdylib
crate type is supported and notdylib
.rust/compiler/rustc_target/src/spec/mod.rs
Lines 2148 to 2153 in f2becdf
- This is the case for
wasm
base, dynamic linking is supported but notdylib
crate type, onlycdylib
is supported.rust/compiler/rustc_target/src/spec/base/wasm.rs
Lines 58 to 62 in f2becdf
- This is the case for
Originally posted by @jieyouxu in #130860 (comment)