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

Attach minimum Linux versions to provided libcs + incorporate ABI in VersionRange.default() #22225

Merged
merged 4 commits into from
Dec 23, 2024

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Dec 13, 2024

This extends what we already do in std.zig.target.canBuildLibC() for macOS to Linux. Additionally, std.Target.Os.VersionRange.default() is changed to incorporate the ABI into its decision so that it can pick out the right entry in std.zig.target.available_libcs.

…c entry.

(With the exception of x86 since that was available from the beginning.)

These were determined by analyzing the full, reconstructed Git history of the
Linux kernel here: https://landley.net/kdocs/fullhist
The old logic only checked it for macOS, but we also need it to be checked for
Linux now.
This is necessary to pick out the correct minimum OS version from the
std.zig.target.available_libcs list.
@alexrp alexrp force-pushed the libc-linux-os-version branch from 0e9e85d to e8006d5 Compare December 17, 2024 04:04
@alexrp alexrp force-pushed the libc-linux-os-version branch from e8006d5 to 1303109 Compare December 22, 2024 21:06
@alexrp alexrp merged commit f06ca14 into ziglang:master Dec 23, 2024
10 checks passed
@alexrp alexrp deleted the libc-linux-os-version branch December 23, 2024 18:42
@heysokam
Copy link

heysokam commented Mar 8, 2025

@alexrp I believe 0ef01c5 created a circular dependency when starting from Os.Tag and wanting a default Abi for that target:
Abi->Os.tag->Os->VersionRange->Abi

std.Target.Abi.default wants a full std.Target.Os (for accessing its .tag field, nothing more).
But creating a full Os requires a VersionRange, and this PR made it required to have an Abi to create the VersionRange
Which means that, to get the default Abi of an Os.tag, you now need an Abi

Am I misunderstanding the new API? Or is this an accidental dependency?

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