Add support for Musl#30
Open
josephnoir wants to merge 3 commits into
Open
Conversation
Static SDK builds on Linux use Musl instead of Glibc. This adds import
guards to switch to Musl when available. Two other changes are necessary
to adopt to differences between the two:
* SOCK_{STREAM,DGRAM,RAW} do not have a raw_value member in Musl
* sin6_addr members have different names
Building with the netlink flag relvealed a problem with the imports
there. Adjusting the guard around importing the headers resolves that.
rnro
reviewed
Jun 19, 2026
| @@ -13,7 +13,11 @@ | |||
| //===----------------------------------------------------------------------===// | |||
|
|
|||
| #if os(Linux) | |||
Contributor
There was a problem hiding this comment.
Is this outer check still needed or can it be a strait Glibc/Musl/not standalone check? I don't really have a strong opinion which is better even if it is technically valid to have the structure flat, only a weak preference.
Author
There was a problem hiding this comment.
This can indeed be flattened. I don't have a strong preference either. Removing lines makes it a bit easier to parse, so addressed in 28a6ab2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Static SDK builds on Linux use Musl instead of Glibc. This adds import guards to switch to Musl when available. Two other changes are necessary to adopt to differences between the two (check
SystemSocket.swift):SOCK_{STREAM,DGRAM,RAW}do not have araw_valuemember in Muslsin6_addrmembers have different namesBuilding with the netlink flag revealed a problem with the imports there. Adjusting the guard around importing the headers resolves that.