aboutsummaryrefslogtreecommitdiff
path: root/src/target.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-01-08 13:43:10 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-08 13:43:10 -0700
commited410b9c1e9a09e674f862b5f3af9d207837a472 (patch)
treefcd420c65cc1a2623c74b47885017ef0c50da21d /src/target.zig
parent8fd15c6ca8b93fa9888e2641ebec149f6d600643 (diff)
downloadzig-ed410b9c1e9a09e674f862b5f3af9d207837a472.tar.gz
zig-ed410b9c1e9a09e674f862b5f3af9d207837a472.zip
lift artificial restriction on minimum glibc version
Fixes a regression introduced in c22d1c00a8825f60e7b01b97c6f73cbc21ca8257. See #17769
Diffstat (limited to 'src/target.zig')
-rw-r--r--src/target.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/target.zig b/src/target.zig
index 8c66017e79..d8b974253f 100644
--- a/src/target.zig
+++ b/src/target.zig
@@ -12,10 +12,7 @@ pub const ArchOsAbi = struct {
abi: std.Target.Abi,
os_ver: ?std.SemanticVersion = null,
- // Minimum glibc version that provides support for the arch/os (for
- // .abi = .gnu). For most entries, the .glibc_min is null,
- // meaning the Zig minimum required by the standard library (see
- // glibc_min_version) is sufficient.
+ // Minimum glibc version that provides support for the arch/os when ABI is GNU.
glibc_min: ?std.SemanticVersion = null,
};
@@ -82,9 +79,6 @@ pub const available_libcs = [_]ArchOsAbi{
.{ .arch = .x86_64, .os = .macos, .abi = .none, .os_ver = .{ .major = 10, .minor = 7, .patch = 0 } },
};
-/// Minimum glibc version, due to dependencies from the Zig standard library on glibc symbols
-pub const glibc_min_version: std.SemanticVersion = .{ .major = 2, .minor = 17, .patch = 0 };
-
pub fn libCGenericName(target: std.Target) [:0]const u8 {
switch (target.os.tag) {
.windows => return "mingw",
@@ -165,7 +159,7 @@ pub fn canBuildLibC(target: std.Target) bool {
}
// Ensure glibc (aka *-linux-gnu) version is supported
if (target.isGnuLibC()) {
- const min_glibc_ver = libc.glibc_min orelse glibc_min_version;
+ const min_glibc_ver = libc.glibc_min orelse return true;
const target_glibc_ver = target.os.version_range.linux.glibc;
return target_glibc_ver.order(min_glibc_ver) != .lt;
}