-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
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
/// Whether dynamic linking is available on this target. Defaults to false. pub dynamic_linking: bool, /// Whether dynamic linking can export TLS globals. Defaults to true. pub dll_tls_export: bool, /// If dynamic linking is available, whether only cdylibs are supported. pub only_cdylib: bool, - 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
// we allow dynamic linking, but only cdylibs. Basically we allow a // final library artifact that exports some symbols (a wasm module) but // we don't allow intermediate `dylib` crate types dynamic_linking: true, only_cdylib: true,
- This is the case for
Originally posted by @jieyouxu in #130860 (comment)
Metadata
Metadata
Assignees
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)