mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
test: Properly limit glibc_compat versions based on the host
This commit is contained in:
parent
3d7fb4f204
commit
80c3de40b3
@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build & run a C test case against a sampling of supported glibc versions
|
// Build & run a C test case against a sampling of supported glibc versions
|
||||||
for ([_][]const u8{
|
versions: for ([_][]const u8{
|
||||||
// "native-linux-gnu.2.0", // fails with a pile of missing symbols.
|
// "native-linux-gnu.2.0", // fails with a pile of missing symbols.
|
||||||
"native-linux-gnu.2.2.5",
|
"native-linux-gnu.2.2.5",
|
||||||
"native-linux-gnu.2.4",
|
"native-linux-gnu.2.4",
|
||||||
@ -52,9 +52,14 @@ pub fn build(b: *std.Build) void {
|
|||||||
const glibc_ver = target.result.os.version_range.linux.glibc;
|
const glibc_ver = target.result.os.version_range.linux.glibc;
|
||||||
|
|
||||||
// only build test if glibc version supports the architecture
|
// only build test if glibc version supports the architecture
|
||||||
if (target.result.cpu.arch.isAARCH64()) {
|
for (std.zig.target.available_libcs) |libc| {
|
||||||
if (glibc_ver.order(.{ .major = 2, .minor = 17, .patch = 0 }) == .lt) {
|
if (libc.arch != target.result.cpu.arch or
|
||||||
|
libc.os != target.result.os.tag or
|
||||||
|
libc.abi != target.result.abi)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (libc.glibc_min) |min| {
|
||||||
|
if (glibc_ver.order(min) == .lt) continue :versions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +152,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build & run a Zig test case against a sampling of supported glibc versions
|
// Build & run a Zig test case against a sampling of supported glibc versions
|
||||||
for ([_][]const u8{
|
versions: for ([_][]const u8{
|
||||||
"native-linux-gnu.2.17", // Currently oldest supported, see #17769
|
"native-linux-gnu.2.17", // Currently oldest supported, see #17769
|
||||||
"native-linux-gnu.2.23",
|
"native-linux-gnu.2.23",
|
||||||
"native-linux-gnu.2.28",
|
"native-linux-gnu.2.28",
|
||||||
@ -161,6 +166,18 @@ pub fn build(b: *std.Build) void {
|
|||||||
|
|
||||||
const glibc_ver = target.result.os.version_range.linux.glibc;
|
const glibc_ver = target.result.os.version_range.linux.glibc;
|
||||||
|
|
||||||
|
// only build test if glibc version supports the architecture
|
||||||
|
for (std.zig.target.available_libcs) |libc| {
|
||||||
|
if (libc.arch != target.result.cpu.arch or
|
||||||
|
libc.os != target.result.os.tag or
|
||||||
|
libc.abi != target.result.abi)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (libc.glibc_min) |min| {
|
||||||
|
if (glibc_ver.order(min) == .lt) continue :versions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = t,
|
.name = t,
|
||||||
.root_module = b.createModule(.{
|
.root_module = b.createModule(.{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user