std.Target: Add Os.HurdVersionRange for Os.Tag.hurd.

This is necessary since isGnuLibC() is true for hurd, so we need to be able to
represent a glibc version for it.

Also add an Os.TaggedVersionRange.gnuLibCVersion() convenience function.
This commit is contained in:
Alex Rønne Petersen
2024-11-23 17:57:39 +01:00
parent 6d781e0955
commit 24ecf45569
14 changed files with 111 additions and 39 deletions

View File

@@ -5,10 +5,7 @@ const builtin = @import("builtin");
// run-time glibc version needs to be new enough. Check the host's glibc
// version. Note that this does not allow for translation/vm/emulation
// services to run these tests.
const running_glibc_ver: ?std.SemanticVersion = switch (builtin.os.tag) {
.linux => builtin.os.version_range.linux.glibc,
else => null,
};
const running_glibc_ver = builtin.os.versionRange().gnuLibCVersion();
pub fn build(b: *std.Build) void {
const test_step = b.step("test", "Test");

View File

@@ -21,7 +21,7 @@ const c_string = @cImport(
);
// Version of glibc this test is being built to run against
const glibc_ver = builtin.target.os.version_range.linux.glibc;
const glibc_ver = builtin.os.versionRange().gnuLibCVersion().?;
// PR #17034 - fstat moved between libc_nonshared and libc
fn checkStat() !void {