Skip to content

[SDK Support] Make sure to look in swift_static rather than just swift. #1821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Feb 25, 2025

If we're building a statically linked executable, we should look in usr/lib/swift_static for swiftrt.o, rather than looking in usr/lib/swift. Not doing this breaks the Static SDK for Linux.

rdar://145549541

…wift`.

If we're building a statically linked executable, we should look in
`usr/lib/swift_static` for `swiftrt.o`, rather than looking in
`usr/lib/swift`.  Not doing this breaks the Static SDK for Linux.

rdar://145549541
@al45tair al45tair requested review from hyp and artemcm February 25, 2025 09:59
@al45tair al45tair changed the title [SDK Support] Make sure to look in swift_static rather than just `swif [SDK Support] Make sure to look in swift_static rather than just swift. Feb 25, 2025
@al45tair
Copy link
Contributor Author

al45tair commented Feb 25, 2025

Explanation: Without this change, when -static-stdlib or -static-executable are used, we look in the wrong place for swiftrt.o. With the Static SDK for Linux, this won't work because there is no swiftrt.o in usr/lib/swift, since we only support static linking.
Risk: Low. Only affects static linking with cross-compilation.
Original PR: #1820
Reviewed by: @artemcm
Resolves: rdar://145549541
Tests: None at present. I'm going to add a test to the Static SDK for Linux build process that will make sure that we don't have a repeat of this kind of problem.

@al45tair
Copy link
Contributor Author

@swift-ci Please test

@al45tair al45tair merged commit baf18cf into swiftlang:release/6.1 Feb 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants