authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-14 09:40:17-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-15 15:32:18+02:00
log0cb558ba3abb0ac7b48c1a30c9a13c924f950172
tree5222b60e57d297f931a98a23828a97d24d9f7b5b
parent9dc47599022e2969ef8975624cad630d14984080

better default min versions for freebsd and netbsd

Without this change, by default you get a failure when trying to cross compile for these targets. freebsd was error: undefined symbol: __libc_start1 netbsd was warning: invalid target NetBSD libc version: 9.4.0 error: unable to build NetBSD libc shared objects: InvalidTargetLibCVersion now they work by default

2 files changed, 2 insertions(+), 122 deletions(-)

lib/std/Target.zig+2-2
...@@ -507,7 +507,7 @@ pub const Os = struct {...@@ -507,7 +507,7 @@ pub const Os = struct {
507 .freebsd => .{507 .freebsd => .{
508 .semver = .{508 .semver = .{
509 .min = blk: {509 .min = blk: {
510 const default_min: std.SemanticVersion = .{ .major = 13, .minor = 4, .patch = 0 };510 const default_min: std.SemanticVersion = .{ .major = 14, .minor = 0, .patch = 0 };
511511
512 for (std.zig.target.available_libcs) |libc| {512 for (std.zig.target.available_libcs) |libc| {
513 if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;513 if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;
...@@ -525,7 +525,7 @@ pub const Os = struct {...@@ -525,7 +525,7 @@ pub const Os = struct {
525 .netbsd => .{525 .netbsd => .{
526 .semver = .{526 .semver = .{
527 .min = blk: {527 .min = blk: {
528 const default_min: std.SemanticVersion = .{ .major = 9, .minor = 4, .patch = 0 };528 const default_min: std.SemanticVersion = .{ .major = 10, .minor = 1, .patch = 0 };
529529
530 for (std.zig.target.available_libcs) |libc| {530 for (std.zig.target.available_libcs) |libc| {
531 if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;531 if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;
test/tests.zig-120
...@@ -104,12 +104,6 @@ const test_targets = blk: {...@@ -104,12 +104,6 @@ const test_targets = blk: {
104 .target = .{104 .target = .{
105 .cpu_arch = .aarch64,105 .cpu_arch = .aarch64,
106 .os_tag = .freebsd,106 .os_tag = .freebsd,
107 // Remove this when we bump our baseline to 14.0.0.
108 .os_version_min = .{ .semver = .{
109 .major = 14,
110 .minor = 0,
111 .patch = 0,
112 } },
113 .abi = .none,107 .abi = .none,
114 },108 },
115 .link_libc = true,109 .link_libc = true,
...@@ -119,12 +113,6 @@ const test_targets = blk: {...@@ -119,12 +113,6 @@ const test_targets = blk: {
119 .target = .{113 .target = .{
120 .cpu_arch = .arm,114 .cpu_arch = .arm,
121 .os_tag = .freebsd,115 .os_tag = .freebsd,
122 // Remove this when we bump our baseline to 14.0.0.
123 .os_version_min = .{ .semver = .{
124 .major = 14,
125 .minor = 0,
126 .patch = 0,
127 } },
128 .abi = .eabihf,116 .abi = .eabihf,
129 },117 },
130 .link_libc = true,118 .link_libc = true,
...@@ -136,12 +124,6 @@ const test_targets = blk: {...@@ -136,12 +124,6 @@ const test_targets = blk: {
136 .target = .{124 .target = .{
137 .cpu_arch = .powerpc64,125 .cpu_arch = .powerpc64,
138 .os_tag = .freebsd,126 .os_tag = .freebsd,
139 // Remove this when we bump our baseline to 14.0.0.
140 .os_version_min = .{ .semver = .{
141 .major = 14,
142 .minor = 0,
143 .patch = 0,
144 } },
145 .abi = .none,127 .abi = .none,
146 },128 },
147 .link_libc = true,129 .link_libc = true,
...@@ -151,12 +133,6 @@ const test_targets = blk: {...@@ -151,12 +133,6 @@ const test_targets = blk: {
151 .target = .{133 .target = .{
152 .cpu_arch = .powerpc64le,134 .cpu_arch = .powerpc64le,
153 .os_tag = .freebsd,135 .os_tag = .freebsd,
154 // Remove this when we bump our baseline to 14.0.0.
155 .os_version_min = .{ .semver = .{
156 .major = 14,
157 .minor = 0,
158 .patch = 0,
159 } },
160 .abi = .none,136 .abi = .none,
161 },137 },
162 .link_libc = true,138 .link_libc = true,
...@@ -166,12 +142,6 @@ const test_targets = blk: {...@@ -166,12 +142,6 @@ const test_targets = blk: {
166 .target = .{142 .target = .{
167 .cpu_arch = .riscv64,143 .cpu_arch = .riscv64,
168 .os_tag = .freebsd,144 .os_tag = .freebsd,
169 // Remove this when we bump our baseline to 14.0.0.
170 .os_version_min = .{ .semver = .{
171 .major = 14,
172 .minor = 0,
173 .patch = 0,
174 } },
175 .abi = .none,145 .abi = .none,
176 },146 },
177 .link_libc = true,147 .link_libc = true,
...@@ -181,12 +151,6 @@ const test_targets = blk: {...@@ -181,12 +151,6 @@ const test_targets = blk: {
181 .target = .{151 .target = .{
182 .cpu_arch = .x86_64,152 .cpu_arch = .x86_64,
183 .os_tag = .freebsd,153 .os_tag = .freebsd,
184 // Remove this when we bump our baseline to 14.0.0.
185 .os_version_min = .{ .semver = .{
186 .major = 14,
187 .minor = 0,
188 .patch = 0,
189 } },
190 .abi = .none,154 .abi = .none,
191 },155 },
192 .link_libc = true,156 .link_libc = true,
...@@ -1236,12 +1200,6 @@ const test_targets = blk: {...@@ -1236,12 +1200,6 @@ const test_targets = blk: {
1236 .target = .{1200 .target = .{
1237 .cpu_arch = .aarch64,1201 .cpu_arch = .aarch64,
1238 .os_tag = .netbsd,1202 .os_tag = .netbsd,
1239 // Remove this when we bump our baseline to 10.1.0.
1240 .os_version_min = .{ .semver = .{
1241 .major = 10,
1242 .minor = 1,
1243 .patch = 0,
1244 } },
1245 .abi = .none,1203 .abi = .none,
1246 },1204 },
1247 .link_libc = true,1205 .link_libc = true,
...@@ -1251,12 +1209,6 @@ const test_targets = blk: {...@@ -1251,12 +1209,6 @@ const test_targets = blk: {
1251 .target = .{1209 .target = .{
1252 .cpu_arch = .aarch64_be,1210 .cpu_arch = .aarch64_be,
1253 .os_tag = .netbsd,1211 .os_tag = .netbsd,
1254 // Remove this when we bump our baseline to 10.1.0.
1255 .os_version_min = .{ .semver = .{
1256 .major = 10,
1257 .minor = 1,
1258 .patch = 0,
1259 } },
1260 .abi = .none,1212 .abi = .none,
1261 },1213 },
1262 .link_libc = true,1214 .link_libc = true,
...@@ -1266,12 +1218,6 @@ const test_targets = blk: {...@@ -1266,12 +1218,6 @@ const test_targets = blk: {
1266 .target = .{1218 .target = .{
1267 .cpu_arch = .arm,1219 .cpu_arch = .arm,
1268 .os_tag = .netbsd,1220 .os_tag = .netbsd,
1269 // Remove this when we bump our baseline to 10.1.0.
1270 .os_version_min = .{ .semver = .{
1271 .major = 10,
1272 .minor = 1,
1273 .patch = 0,
1274 } },
1275 .abi = .eabi,1221 .abi = .eabi,
1276 },1222 },
1277 .link_libc = true,1223 .link_libc = true,
...@@ -1280,12 +1226,6 @@ const test_targets = blk: {...@@ -1280,12 +1226,6 @@ const test_targets = blk: {
1280 .target = .{1226 .target = .{
1281 .cpu_arch = .arm,1227 .cpu_arch = .arm,
1282 .os_tag = .netbsd,1228 .os_tag = .netbsd,
1283 // Remove this when we bump our baseline to 10.1.0.
1284 .os_version_min = .{ .semver = .{
1285 .major = 10,
1286 .minor = 1,
1287 .patch = 0,
1288 } },
1289 .abi = .eabihf,1229 .abi = .eabihf,
1290 },1230 },
1291 .link_libc = true,1231 .link_libc = true,
...@@ -1295,12 +1235,6 @@ const test_targets = blk: {...@@ -1295,12 +1235,6 @@ const test_targets = blk: {
1295 .target = .{1235 .target = .{
1296 .cpu_arch = .armeb,1236 .cpu_arch = .armeb,
1297 .os_tag = .netbsd,1237 .os_tag = .netbsd,
1298 // Remove this when we bump our baseline to 10.1.0.
1299 .os_version_min = .{ .semver = .{
1300 .major = 10,
1301 .minor = 1,
1302 .patch = 0,
1303 } },
1304 .abi = .eabi,1238 .abi = .eabi,
1305 },1239 },
1306 .link_libc = true,1240 .link_libc = true,
...@@ -1309,12 +1243,6 @@ const test_targets = blk: {...@@ -1309,12 +1243,6 @@ const test_targets = blk: {
1309 .target = .{1243 .target = .{
1310 .cpu_arch = .armeb,1244 .cpu_arch = .armeb,
1311 .os_tag = .netbsd,1245 .os_tag = .netbsd,
1312 // Remove this when we bump our baseline to 10.1.0.
1313 .os_version_min = .{ .semver = .{
1314 .major = 10,
1315 .minor = 1,
1316 .patch = 0,
1317 } },
1318 .abi = .eabihf,1246 .abi = .eabihf,
1319 },1247 },
1320 .link_libc = true,1248 .link_libc = true,
...@@ -1324,12 +1252,6 @@ const test_targets = blk: {...@@ -1324,12 +1252,6 @@ const test_targets = blk: {
1324 .target = .{1252 .target = .{
1325 .cpu_arch = .mips,1253 .cpu_arch = .mips,
1326 .os_tag = .netbsd,1254 .os_tag = .netbsd,
1327 // Remove this when we bump our baseline to 10.1.0.
1328 .os_version_min = .{ .semver = .{
1329 .major = 10,
1330 .minor = 1,
1331 .patch = 0,
1332 } },
1333 .abi = .eabi,1255 .abi = .eabi,
1334 },1256 },
1335 .link_libc = true,1257 .link_libc = true,
...@@ -1338,12 +1260,6 @@ const test_targets = blk: {...@@ -1338,12 +1260,6 @@ const test_targets = blk: {
1338 .target = .{1260 .target = .{
1339 .cpu_arch = .mips,1261 .cpu_arch = .mips,
1340 .os_tag = .netbsd,1262 .os_tag = .netbsd,
1341 // Remove this when we bump our baseline to 10.1.0.
1342 .os_version_min = .{ .semver = .{
1343 .major = 10,
1344 .minor = 1,
1345 .patch = 0,
1346 } },
1347 .abi = .eabihf,1263 .abi = .eabihf,
1348 },1264 },
1349 .link_libc = true,1265 .link_libc = true,
...@@ -1353,12 +1269,6 @@ const test_targets = blk: {...@@ -1353,12 +1269,6 @@ const test_targets = blk: {
1353 .target = .{1269 .target = .{
1354 .cpu_arch = .mipsel,1270 .cpu_arch = .mipsel,
1355 .os_tag = .netbsd,1271 .os_tag = .netbsd,
1356 // Remove this when we bump our baseline to 10.1.0.
1357 .os_version_min = .{ .semver = .{
1358 .major = 10,
1359 .minor = 1,
1360 .patch = 0,
1361 } },
1362 .abi = .eabi,1272 .abi = .eabi,
1363 },1273 },
1364 .link_libc = true,1274 .link_libc = true,
...@@ -1367,12 +1277,6 @@ const test_targets = blk: {...@@ -1367,12 +1277,6 @@ const test_targets = blk: {
1367 .target = .{1277 .target = .{
1368 .cpu_arch = .mipsel,1278 .cpu_arch = .mipsel,
1369 .os_tag = .netbsd,1279 .os_tag = .netbsd,
1370 // Remove this when we bump our baseline to 10.1.0.
1371 .os_version_min = .{ .semver = .{
1372 .major = 10,
1373 .minor = 1,
1374 .patch = 0,
1375 } },
1376 .abi = .eabihf,1280 .abi = .eabihf,
1377 },1281 },
1378 .link_libc = true,1282 .link_libc = true,
...@@ -1382,12 +1286,6 @@ const test_targets = blk: {...@@ -1382,12 +1286,6 @@ const test_targets = blk: {
1382 .target = .{1286 .target = .{
1383 .cpu_arch = .powerpc,1287 .cpu_arch = .powerpc,
1384 .os_tag = .netbsd,1288 .os_tag = .netbsd,
1385 // Remove this when we bump our baseline to 10.1.0.
1386 .os_version_min = .{ .semver = .{
1387 .major = 10,
1388 .minor = 1,
1389 .patch = 0,
1390 } },
1391 .abi = .eabi,1289 .abi = .eabi,
1392 },1290 },
1393 .link_libc = true,1291 .link_libc = true,
...@@ -1396,12 +1294,6 @@ const test_targets = blk: {...@@ -1396,12 +1294,6 @@ const test_targets = blk: {
1396 .target = .{1294 .target = .{
1397 .cpu_arch = .powerpc,1295 .cpu_arch = .powerpc,
1398 .os_tag = .netbsd,1296 .os_tag = .netbsd,
1399 // Remove this when we bump our baseline to 10.1.0.
1400 .os_version_min = .{ .semver = .{
1401 .major = 10,
1402 .minor = 1,
1403 .patch = 0,
1404 } },
1405 .abi = .eabihf,1297 .abi = .eabihf,
1406 },1298 },
1407 .link_libc = true,1299 .link_libc = true,
...@@ -1411,12 +1303,6 @@ const test_targets = blk: {...@@ -1411,12 +1303,6 @@ const test_targets = blk: {
1411 .target = .{1303 .target = .{
1412 .cpu_arch = .x86,1304 .cpu_arch = .x86,
1413 .os_tag = .netbsd,1305 .os_tag = .netbsd,
1414 // Remove this when we bump our baseline to 10.1.0.
1415 .os_version_min = .{ .semver = .{
1416 .major = 10,
1417 .minor = 1,
1418 .patch = 0,
1419 } },
1420 .abi = .none,1306 .abi = .none,
1421 },1307 },
1422 .link_libc = true,1308 .link_libc = true,
...@@ -1426,12 +1312,6 @@ const test_targets = blk: {...@@ -1426,12 +1312,6 @@ const test_targets = blk: {
1426 .target = .{1312 .target = .{
1427 .cpu_arch = .x86_64,1313 .cpu_arch = .x86_64,
1428 .os_tag = .netbsd,1314 .os_tag = .netbsd,
1429 // Remove this when we bump our baseline to 10.1.0.
1430 .os_version_min = .{ .semver = .{
1431 .major = 10,
1432 .minor = 1,
1433 .patch = 0,
1434 } },
1435 .abi = .none,1315 .abi = .none,
1436 },1316 },
1437 .link_libc = true,1317 .link_libc = true,