Skip to content
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

More changes to support building with Musl. #2628

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

al45tair
Copy link
Contributor

Support using NIO with Musl on Linux.

Motivation:

I'm trying to make Swift NIO work on top of Musl so that we can build fully statically linked binaries for Linux.

Modifications:

Use direct syscall for renameat2 because Musl doesn't include a wrapper for it. Similarly, define the constants ourselves.

Add Musl imports in relevant places.

Result:

Building NIO on Musl will work again :-)

Use direct syscall for `renameat2` because Musl doesn't include
a wrapper for it.  Similarly, define the constants ourselves.

Add Musl imports in relevant places.
@Lukasa Lukasa added the semver/patch No public API change. label Jan 18, 2024
@Lukasa Lukasa enabled auto-merge (squash) January 18, 2024 15:25
@Lukasa Lukasa merged commit c14d7d6 into apple:main Jan 18, 2024
8 of 10 checks passed
Austinpayne added a commit to Austinpayne/swift-nio that referenced this pull request Feb 9, 2024
When using `-Xcc -Werror` flags redefining macros results in a compilation.
Instead we check if they are not defined before defining for the musl case.

Fixes regression in apple#2628.
Austinpayne added a commit to Austinpayne/swift-nio that referenced this pull request Feb 9, 2024
When using `-Xcc -Werror` flags redefining macros results in a compilation
error. Instead we check if they are not defined before defining for the
musl case.

Fixes regression in apple#2628.
glbrntt added a commit that referenced this pull request Feb 9, 2024
When using `-Xcc -Werror` flags redefining macros results in a compilation
error. Instead we check if they are not defined before defining for the
musl case.

Fixes regression in #2628.

Co-authored-by: Austin Payne <austin@passivelogic.com>
Co-authored-by: George Barnett <gbarnett@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants