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.
This commit is contained in:
Pat Tullmann 2024-02-19 17:30:39 -08:00
parent 8bee879fc2
commit ed795a907d
2 changed files with 8 additions and 1 deletions

View File

@ -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 } },

View File

@ -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,