commit 5668c8b7babfdc00ace04feceb9bcf8b95681982 (tree)
parent b3537d0f4adeff824348a4918b495976ae230731
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Sat, 26 Apr 2025 14:46:36 +0200
std.Target: Bump minimum glibc to 2.34 for arches migrating to 64-bit time.
https://github.com/ziglang/zig/issues/21738#issuecomment-2822411842
Diffstat:
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/lib/std/Target.zig b/lib/std/Target.zig
@@ -470,7 +470,28 @@ pub const Os = struct {
.max = .{ .major = 6, .minor = 13, .patch = 4 },
},
.glibc = blk: {
- const default_min: std.SemanticVersion = .{ .major = 2, .minor = 31, .patch = 0 };
+ // For 32-bit targets that traditionally used 32-bit time, we require
+ // glibc 2.34 for full 64-bit time support. For everything else, we only
+ // require glibc 2.31.
+ const default_min: std.SemanticVersion = switch (arch) {
+ .arm,
+ .armeb,
+ .csky,
+ .m68k,
+ .mips,
+ .mipsel,
+ .powerpc,
+ .sparc,
+ .x86,
+ => .{ .major = 2, .minor = 34, .patch = 0 },
+ .mips64,
+ .mips64el,
+ => if (abi == .gnuabin32)
+ .{ .major = 2, .minor = 34, .patch = 0 }
+ else
+ .{ .major = 2, .minor = 31, .patch = 0 },
+ else => .{ .major = 2, .minor = 31, .patch = 0 },
+ };
for (std.zig.target.available_libcs) |libc| {
if (libc.os != tag or libc.arch != arch or libc.abi != abi) continue;