From f3e851dbd08c5467326ce983c4ae8ae2a1dc369c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 11 May 2025 11:13:22 +0200 Subject: [PATCH] compiler: Link libc by default when targeting FreeBSD. We don't yet have a direct syscall layer in std.os.freebsd. --- src/Compilation/Config.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig index 82496845ca..dbfe6cc2ec 100644 --- a/src/Compilation/Config.zig +++ b/src/Compilation/Config.zig @@ -335,6 +335,13 @@ pub fn resolve(options: Options) ResolveError!Config { break :b true; } if (options.link_libc) |x| break :b x; + switch (target.os.tag) { + // These targets don't require libc, but we don't yet have a syscall layer for them, + // so we default to linking libc for now. + .freebsd, + => break :b true, + else => {}, + } if (options.ensure_libc_on_non_freestanding and target.os.tag != .freestanding) break :b true;