| ... | @@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -33,7 +33,7 @@ pub fn build(b: *std.Build) void { |
| 33 | } | 33 | } |
| 34 | | 34 | |
| 35 | // Build & run a C test case against a sampling of supported glibc versions | 35 | // Build & run a C test case against a sampling of supported glibc versions |
| 36 | for ([_][]const u8{ | 36 | versions: for ([_][]const u8{ |
| 37 | // "native-linux-gnu.2.0", // fails with a pile of missing symbols. | 37 | // "native-linux-gnu.2.0", // fails with a pile of missing symbols. |
| 38 | "native-linux-gnu.2.2.5", | 38 | "native-linux-gnu.2.2.5", |
| 39 | "native-linux-gnu.2.4", | 39 | "native-linux-gnu.2.4", |
| ... | @@ -52,9 +52,14 @@ pub fn build(b: *std.Build) void { | ... | @@ -52,9 +52,14 @@ pub fn build(b: *std.Build) void { |
| 52 | const glibc_ver = target.result.os.version_range.linux.glibc; | 52 | const glibc_ver = target.result.os.version_range.linux.glibc; |
| 53 | | 53 | |
| 54 | // only build test if glibc version supports the architecture | 54 | // only build test if glibc version supports the architecture |
| 55 | if (target.result.cpu.arch.isAARCH64()) { | 55 | for (std.zig.target.available_libcs) |libc| { |
| 56 | if (glibc_ver.order(.{ .major = 2, .minor = 17, .patch = 0 }) == .lt) { | 56 | if (libc.arch != target.result.cpu.arch or |
| | 57 | libc.os != target.result.os.tag or |
| | 58 | libc.abi != target.result.abi) |
| 57 | continue; | 59 | continue; |
| | 60 | |
| | 61 | if (libc.glibc_min) |min| { |
| | 62 | if (glibc_ver.order(min) == .lt) continue :versions; |
| 58 | } | 63 | } |
| 59 | } | 64 | } |
| 60 | | 65 | |
| ... | @@ -147,7 +152,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -147,7 +152,7 @@ pub fn build(b: *std.Build) void { |
| 147 | } | 152 | } |
| 148 | | 153 | |
| 149 | // Build & run a Zig test case against a sampling of supported glibc versions | 154 | // Build & run a Zig test case against a sampling of supported glibc versions |
| 150 | for ([_][]const u8{ | 155 | versions: for ([_][]const u8{ |
| 151 | "native-linux-gnu.2.17", // Currently oldest supported, see #17769 | 156 | "native-linux-gnu.2.17", // Currently oldest supported, see #17769 |
| 152 | "native-linux-gnu.2.23", | 157 | "native-linux-gnu.2.23", |
| 153 | "native-linux-gnu.2.28", | 158 | "native-linux-gnu.2.28", |
| ... | @@ -161,6 +166,18 @@ pub fn build(b: *std.Build) void { | ... | @@ -161,6 +166,18 @@ pub fn build(b: *std.Build) void { |
| 161 | | 166 | |
| 162 | const glibc_ver = target.result.os.version_range.linux.glibc; | 167 | const glibc_ver = target.result.os.version_range.linux.glibc; |
| 163 | | 168 | |
| | 169 | // only build test if glibc version supports the architecture |
| | 170 | for (std.zig.target.available_libcs) |libc| { |
| | 171 | if (libc.arch != target.result.cpu.arch or |
| | 172 | libc.os != target.result.os.tag or |
| | 173 | libc.abi != target.result.abi) |
| | 174 | continue; |
| | 175 | |
| | 176 | if (libc.glibc_min) |min| { |
| | 177 | if (glibc_ver.order(min) == .lt) continue :versions; |
| | 178 | } |
| | 179 | } |
| | 180 | |
| 164 | const exe = b.addExecutable(.{ | 181 | const exe = b.addExecutable(.{ |
| 165 | .name = t, | 182 | .name = t, |
| 166 | .root_module = b.createModule(.{ | 183 | .root_module = b.createModule(.{ |