Skip to content

[main] Fixing post-swift-foundation corelibs-foundation MUSL static SDK builds #5069

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 3 commits into from
Aug 16, 2024

Conversation

etcwilde
Copy link
Contributor

Putting back definitions and flags that were dropped when doing the Swift-Foundation re-core that are necessary when building for the static SDK. This is primarily checks for symbol availability.

This will not affect SwiftPM builds, which will continue to define strlcpy and strlcat everywhere, even on systems that define them in the libc, resulting in build failures. The CMake build will work in these environments.

6.0: #5060

Several definitions and flags were dropped from the build when moving to
swift-froundation.
This patch puts back the ones that we need in order to build against
musl.

Since the musl builds are static, we also need to pick up the link to
libRT or dispatch will fail to link.
This fixes how we pick up SOCK_STREAM and IPPROTO_TCP from musl. We
weren't before so it was just failing to build.
Add comment describing why we need to check for the availability of
strlcat/strlcpy and issetguid.

Also removed setting the _GNU_SOURCES compile-definition and
-fblocks flag as it's already added through one of the global variables.
@jmschonfeld
Copy link
Contributor

@swift-ci please test

@etcwilde
Copy link
Contributor Author

@swift-ci please test Linux

@etcwilde etcwilde merged commit e0f1615 into swiftlang:main Aug 16, 2024
2 of 3 checks passed
@etcwilde etcwilde deleted the ewilde/main-musl-builds branch August 16, 2024 17:07
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.

3 participants