Skip to content

Add support for Musl#30

Open
josephnoir wants to merge 3 commits into
mainfrom
rh/linux-static-sdk-builds
Open

Add support for Musl#30
josephnoir wants to merge 3 commits into
mainfrom
rh/linux-static-sdk-builds

Conversation

@josephnoir

Copy link
Copy Markdown

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 a raw_value member in Musl
  • sin6_addr members have different names

Building with the netlink flag revealed a problem with the imports there. Adjusting the guard around importing the headers resolves that.

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 rnro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@@ -13,7 +13,11 @@
//===----------------------------------------------------------------------===//

#if os(Linux)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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