Skip to content

Commit d29ba75

Browse files
committed
Compilation.Config: Default to dynamic linking with NetBSD libc.
1 parent 1a82cce commit d29ba75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Compilation/Config.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ pub fn resolve(options: Options) ResolveError!Config {
362362
if (explicitly_exe_or_dyn_lib and link_libc and
363363
(target_util.osRequiresLibC(target) or
364364
// For these libcs, Zig can only provide dynamic libc when cross-compiling.
365-
((target.isGnuLibC() or target.isFreeBSDLibC()) and !options.resolved_target.is_native_abi)))
365+
((target.isGnuLibC() or target.isFreeBSDLibC() or target.isNetBSDLibC()) and
366+
!options.resolved_target.is_native_abi)))
366367
{
367368
if (options.link_mode == .static) return error.LibCRequiresDynamicLinking;
368369
break :b .dynamic;
@@ -386,7 +387,7 @@ pub fn resolve(options: Options) ResolveError!Config {
386387
// When targeting systems where the kernel and libc are developed alongside each other,
387388
// dynamic linking is the better default; static libc may contain code that requires
388389
// the very latest kernel version.
389-
if (target.isFreeBSDLibC()) {
390+
if (target.isFreeBSDLibC() or target.isNetBSDLibC()) {
390391
break :b .dynamic;
391392
}
392393
}

0 commit comments

Comments
 (0)