From c22d1c00a8825f60e7b01b97c6f73cbc21ca8257 Mon Sep 17 00:00:00 2001 From: Pat Tullmann Date: Sun, 29 Oct 2023 14:38:48 -0700 Subject: 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 --- src/glibc.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glibc.zig') 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. -- cgit v1.2.3