Skip to content

Commit 0cb558b

Browse files
committed
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
1 parent 9dc4759 commit 0cb558b

File tree

2 files changed

+2
-122
lines changed

2 files changed

+2
-122
lines changed

lib/std/Target.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub const Os = struct {
507507
.freebsd => .{
508508
.semver = .{
509509
.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

512512
for (std.zig.target.available_libcs) |libc| {
513513
if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;
@@ -525,7 +525,7 @@ pub const Os = struct {
525525
.netbsd => .{
526526
.semver = .{
527527
.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

530530
for (std.zig.target.available_libcs) |libc| {
531531
if (libc.arch != arch or libc.os != tag or libc.abi != abi) continue;

test/tests.zig

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ const test_targets = blk: {
104104
.target = .{
105105
.cpu_arch = .aarch64,
106106
.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-
} },
113107
.abi = .none,
114108
},
115109
.link_libc = true,
@@ -119,12 +113,6 @@ const test_targets = blk: {
119113
.target = .{
120114
.cpu_arch = .arm,
121115
.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-
} },
128116
.abi = .eabihf,
129117
},
130118
.link_libc = true,
@@ -136,12 +124,6 @@ const test_targets = blk: {
136124
.target = .{
137125
.cpu_arch = .powerpc64,
138126
.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-
} },
145127
.abi = .none,
146128
},
147129
.link_libc = true,
@@ -151,12 +133,6 @@ const test_targets = blk: {
151133
.target = .{
152134
.cpu_arch = .powerpc64le,
153135
.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-
} },
160136
.abi = .none,
161137
},
162138
.link_libc = true,
@@ -166,12 +142,6 @@ const test_targets = blk: {
166142
.target = .{
167143
.cpu_arch = .riscv64,
168144
.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-
} },
175145
.abi = .none,
176146
},
177147
.link_libc = true,
@@ -181,12 +151,6 @@ const test_targets = blk: {
181151
.target = .{
182152
.cpu_arch = .x86_64,
183153
.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-
} },
190154
.abi = .none,
191155
},
192156
.link_libc = true,
@@ -1236,12 +1200,6 @@ const test_targets = blk: {
12361200
.target = .{
12371201
.cpu_arch = .aarch64,
12381202
.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-
} },
12451203
.abi = .none,
12461204
},
12471205
.link_libc = true,
@@ -1251,12 +1209,6 @@ const test_targets = blk: {
12511209
.target = .{
12521210
.cpu_arch = .aarch64_be,
12531211
.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-
} },
12601212
.abi = .none,
12611213
},
12621214
.link_libc = true,
@@ -1266,12 +1218,6 @@ const test_targets = blk: {
12661218
.target = .{
12671219
.cpu_arch = .arm,
12681220
.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-
} },
12751221
.abi = .eabi,
12761222
},
12771223
.link_libc = true,
@@ -1280,12 +1226,6 @@ const test_targets = blk: {
12801226
.target = .{
12811227
.cpu_arch = .arm,
12821228
.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-
} },
12891229
.abi = .eabihf,
12901230
},
12911231
.link_libc = true,
@@ -1295,12 +1235,6 @@ const test_targets = blk: {
12951235
.target = .{
12961236
.cpu_arch = .armeb,
12971237
.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-
} },
13041238
.abi = .eabi,
13051239
},
13061240
.link_libc = true,
@@ -1309,12 +1243,6 @@ const test_targets = blk: {
13091243
.target = .{
13101244
.cpu_arch = .armeb,
13111245
.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-
} },
13181246
.abi = .eabihf,
13191247
},
13201248
.link_libc = true,
@@ -1324,12 +1252,6 @@ const test_targets = blk: {
13241252
.target = .{
13251253
.cpu_arch = .mips,
13261254
.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-
} },
13331255
.abi = .eabi,
13341256
},
13351257
.link_libc = true,
@@ -1338,12 +1260,6 @@ const test_targets = blk: {
13381260
.target = .{
13391261
.cpu_arch = .mips,
13401262
.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-
} },
13471263
.abi = .eabihf,
13481264
},
13491265
.link_libc = true,
@@ -1353,12 +1269,6 @@ const test_targets = blk: {
13531269
.target = .{
13541270
.cpu_arch = .mipsel,
13551271
.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-
} },
13621272
.abi = .eabi,
13631273
},
13641274
.link_libc = true,
@@ -1367,12 +1277,6 @@ const test_targets = blk: {
13671277
.target = .{
13681278
.cpu_arch = .mipsel,
13691279
.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-
} },
13761280
.abi = .eabihf,
13771281
},
13781282
.link_libc = true,
@@ -1382,12 +1286,6 @@ const test_targets = blk: {
13821286
.target = .{
13831287
.cpu_arch = .powerpc,
13841288
.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-
} },
13911289
.abi = .eabi,
13921290
},
13931291
.link_libc = true,
@@ -1396,12 +1294,6 @@ const test_targets = blk: {
13961294
.target = .{
13971295
.cpu_arch = .powerpc,
13981296
.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-
} },
14051297
.abi = .eabihf,
14061298
},
14071299
.link_libc = true,
@@ -1411,12 +1303,6 @@ const test_targets = blk: {
14111303
.target = .{
14121304
.cpu_arch = .x86,
14131305
.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-
} },
14201306
.abi = .none,
14211307
},
14221308
.link_libc = true,
@@ -1426,12 +1312,6 @@ const test_targets = blk: {
14261312
.target = .{
14271313
.cpu_arch = .x86_64,
14281314
.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-
} },
14351315
.abi = .none,
14361316
},
14371317
.link_libc = true,

0 commit comments

Comments
 (0)