mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.Target.VersionRange: Make default() respect the minimum glibc version.
This commit is contained in:
parent
c339aa655e
commit
948bc91d12
1 changed files with 15 additions and 1 deletions
|
|
@ -483,7 +483,21 @@ pub const Os = struct {
|
|||
.min = .{ .major = 4, .minor = 19, .patch = 0 },
|
||||
.max = .{ .major = 6, .minor = 5, .patch = 7 },
|
||||
},
|
||||
.glibc = .{ .major = 2, .minor = 28, .patch = 0 },
|
||||
.glibc = blk: {
|
||||
const default_min = .{ .major = 2, .minor = 28, .patch = 0 };
|
||||
|
||||
for (std.zig.target.available_libcs) |libc| {
|
||||
// We don't know the ABI here. We can get away with not checking it
|
||||
// for now, but that may not always remain true.
|
||||
if (libc.os != tag or libc.arch != arch) continue;
|
||||
|
||||
if (libc.glibc_min) |min| {
|
||||
if (min.order(default_min) == .gt) break :blk min;
|
||||
}
|
||||
}
|
||||
|
||||
break :blk default_min;
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue