authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-26 14:46:36+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-27 00:24:55+02:00
log5668c8b7babfdc00ace04feceb9bcf8b95681982
treeab83513fdfe7ce1c43a26e6c1d145761a075f86e
parentb3537d0f4adeff824348a4918b495976ae230731

std.Target: Bump minimum glibc to 2.34 for arches migrating to 64-bit time.

https://github.com/ziglang/zig/issues/21738#issuecomment-2822411842

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

lib/std/Target.zig+22-1
...@@ -470,7 +470,28 @@ pub const Os = struct {...@@ -470,7 +470,28 @@ pub const Os = struct {
470 .max = .{ .major = 6, .minor = 13, .patch = 4 },470 .max = .{ .major = 6, .minor = 13, .patch = 4 },
471 },471 },
472 .glibc = blk: {472 .glibc = blk: {
473 const default_min: std.SemanticVersion = .{ .major = 2, .minor = 31, .patch = 0 };473 // For 32-bit targets that traditionally used 32-bit time, we require
474 // glibc 2.34 for full 64-bit time support. For everything else, we only
475 // require glibc 2.31.
476 const default_min: std.SemanticVersion = switch (arch) {
477 .arm,
478 .armeb,
479 .csky,
480 .m68k,
481 .mips,
482 .mipsel,
483 .powerpc,
484 .sparc,
485 .x86,
486 => .{ .major = 2, .minor = 34, .patch = 0 },
487 .mips64,
488 .mips64el,
489 => if (abi == .gnuabin32)
490 .{ .major = 2, .minor = 34, .patch = 0 }
491 else
492 .{ .major = 2, .minor = 31, .patch = 0 },
493 else => .{ .major = 2, .minor = 31, .patch = 0 },
494 };
474495
475 for (std.zig.target.available_libcs) |libc| {496 for (std.zig.target.available_libcs) |libc| {
476 if (libc.os != tag or libc.arch != arch or libc.abi != abi) continue;497 if (libc.os != tag or libc.arch != arch or libc.abi != abi) continue;