commit ed795a907d329487b5fdc6f21e2bace11998e5bf (tree)
parent 8bee879fc247e9885202f690aac677717e708402
Author: Pat Tullmann <pat.github@tullmann.org>
Date: Mon, 19 Feb 2024 17:30:39 -0800
target.zig: Constrain aarch64 to glibc version 2.17 or later
Had constrained the `aarch64_be` target, but not `aarch64`. This
constraint is necessary because earlier versions of glibc do not support
the aarch64 architecture.
Also, skip unsupported test cases.
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/std/zig/target.zig b/lib/std/zig/target.zig
@@ -12,7 +12,7 @@ pub const available_libcs = [_]ArchOsAbi{
.{ .arch = .aarch64_be, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 17, .patch = 0 } },
.{ .arch = .aarch64_be, .os = .linux, .abi = .musl },
.{ .arch = .aarch64_be, .os = .windows, .abi = .gnu },
- .{ .arch = .aarch64, .os = .linux, .abi = .gnu },
+ .{ .arch = .aarch64, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 17, .patch = 0 } },
.{ .arch = .aarch64, .os = .linux, .abi = .musl },
.{ .arch = .aarch64, .os = .windows, .abi = .gnu },
.{ .arch = .aarch64, .os = .macos, .abi = .none, .os_ver = .{ .major = 11, .minor = 0, .patch = 0 } },
diff --git a/test/link/glibc_compat/build.zig b/test/link/glibc_compat/build.zig
@@ -47,6 +47,13 @@ pub fn build(b: *std.Build) void {
const glibc_ver = target.result.os.version_range.linux.glibc;
+ // only build test if glibc version supports the architecture
+ if (target.result.cpu.arch.isAARCH64()) {
+ if (glibc_ver.order(.{ .major = 2, .minor = 17, .patch = 0 }) == .lt) {
+ continue;
+ }
+ }
+
const exe = b.addExecutable(.{
.name = t,
.target = target,