Skip to content

Commit f3e851d

Browse files
committed
compiler: Link libc by default when targeting FreeBSD.
We don't yet have a direct syscall layer in std.os.freebsd.
1 parent 4c2f1e0 commit f3e851d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Compilation/Config.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@ pub fn resolve(options: Options) ResolveError!Config {
335335
break :b true;
336336
}
337337
if (options.link_libc) |x| break :b x;
338+
switch (target.os.tag) {
339+
// These targets don't require libc, but we don't yet have a syscall layer for them,
340+
// so we default to linking libc for now.
341+
.freebsd,
342+
=> break :b true,
343+
else => {},
344+
}
338345
if (options.ensure_libc_on_non_freestanding and target.os.tag != .freestanding)
339346
break :b true;
340347

0 commit comments

Comments
 (0)