authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-02 09:52:19+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-02 09:54:08+02:00
log948bc91d12e147b46d54d82af5e9a9bc2ce25573
tree3501743be61e4b8863f8b46a2fc1ea053b7657c2
parentc339aa655e58a3ecc22f21354b2d6584509a7dbe
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target.VersionRange: Make default() respect the minimum glibc version.


1 files changed, 15 insertions(+), 1 deletions(-)

lib/std/Target.zig+15-1
......@@ -483,7 +483,21 @@ pub const Os = struct {
483483 .min = .{ .major = 4, .minor = 19, .patch = 0 },
484484 .max = .{ .major = 6, .minor = 5, .patch = 7 },
485485 },
486 .glibc = .{ .major = 2, .minor = 28, .patch = 0 },
486 .glibc = blk: {
487 const default_min = .{ .major = 2, .minor = 28, .patch = 0 };
488
489 for (std.zig.target.available_libcs) |libc| {
490 // We don't know the ABI here. We can get away with not checking it
491 // for now, but that may not always remain true.
492 if (libc.os != tag or libc.arch != arch) continue;
493
494 if (libc.glibc_min) |min| {
495 if (min.order(default_min) == .gt) break :blk min;
496 }
497 }
498
499 break :blk default_min;
500 },
487501 },
488502 },
489503