-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itO-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
rustc
uses the SDKROOT
environment variable to figure out details about the SDK to pass onward to the linker (linker stubs and the SDK version). If this flag is not set, or is set for the wrong platform, we fall back to invoking xcrun --sdk $platform --show-sdk-path
.
It might be beneficial to add a commandline flag to allow passing this information as well? This has been requested by Chromium in #131477 (comment), see that for motivation.
Alternatively / additionally, we could add a flag to completely opt out of passing SDK information to the linker, such as -Clinker-features=-sdkroot
(partially reverting to the state before #131477). Such a flag might also be useful for e.g. cargo zigbuild
(which provides the SDK internally).
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itO-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.