aboutsummaryrefslogtreecommitdiff
path: root/src/glibc.zig
diff options
context:
space:
mode:
authorPat Tullmann <pat.github@tullmann.org>2023-10-29 14:38:48 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-04 17:12:07 -0700
commitc22d1c00a8825f60e7b01b97c6f73cbc21ca8257 (patch)
treefb4d555cdb776c4d4aca0e649e299ce6689b8d8a /src/glibc.zig
parent71e809852c34a5a75f86829a188028ec12bbd4ec (diff)
downloadzig-c22d1c00a8825f60e7b01b97c6f73cbc21ca8257.tar.gz
zig-c22d1c00a8825f60e7b01b97c6f73cbc21ca8257.zip
src/target: Restrict usable glibc versions
At a minimum required glibc is v2.17, as earlier versions do not define some symbols (e.g., getauxval()) used by the Zig standard library. Additionally, glibc only supports some architectures at more recent versions (e.g., riscv64 support came in glibc v2.27). So add a `glibc_min` field to `available_libcs` for architectures with stronger version requirements. Extend the existing `canBuildLibC` function to check the target against the Zig minimum, and the architecture/os minimum. Also filter the list shown by `zig targets`, too: $ zig targets | jq -c '.glibc' ["2.17.0","2.18.0","2.19.0","2.20.0","2.21.0","2.22.0","2.23.0","2.24.0","2.25.0","2.26.0","2.27.0","2.28.0","2.29.0","2.30.0","2.31.0","2.32.0","2.33.0","2.34.0","2.35.0","2.36.0","2.37.0","2.38.0"] Fixes #17034 Fixes #17769
Diffstat (limited to 'src/glibc.zig')
-rw-r--r--src/glibc.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glibc.zig b/src/glibc.zig
index d4b6174021..b7483b7012 100644
--- a/src/glibc.zig
+++ b/src/glibc.zig
@@ -20,7 +20,7 @@ pub const Lib = struct {
};
pub const ABI = struct {
- all_versions: []const Version,
+ all_versions: []const Version, // all defined versions (one abilist from v2.0.0 up to current)
all_targets: []const target_util.ArchOsAbi,
/// The bytes from the file verbatim, starting from the u16 number
/// of function inclusions.