aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-05-13 01:46:12 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-05-17 04:41:27 +0200
commitd29ba75c848c6727fdbd796595a5356ef2aa2408 (patch)
tree789a6d33a48a33ffef99f5288ba3938577ed0005 /src/Compilation
parent1a82cceb8c53cc5d4ef684798e0bccb9d220b86c (diff)
downloadzig-d29ba75c848c6727fdbd796595a5356ef2aa2408.tar.gz
zig-d29ba75c848c6727fdbd796595a5356ef2aa2408.zip
Compilation.Config: Default to dynamic linking with NetBSD libc.
Diffstat (limited to 'src/Compilation')
-rw-r--r--src/Compilation/Config.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig
index 493c63f34f..581f1eb624 100644
--- a/src/Compilation/Config.zig
+++ b/src/Compilation/Config.zig
@@ -362,7 +362,8 @@ pub fn resolve(options: Options) ResolveError!Config {
if (explicitly_exe_or_dyn_lib and link_libc and
(target_util.osRequiresLibC(target) or
// For these libcs, Zig can only provide dynamic libc when cross-compiling.
- ((target.isGnuLibC() or target.isFreeBSDLibC()) and !options.resolved_target.is_native_abi)))
+ ((target.isGnuLibC() or target.isFreeBSDLibC() or target.isNetBSDLibC()) and
+ !options.resolved_target.is_native_abi)))
{
if (options.link_mode == .static) return error.LibCRequiresDynamicLinking;
break :b .dynamic;
@@ -386,7 +387,7 @@ pub fn resolve(options: Options) ResolveError!Config {
// When targeting systems where the kernel and libc are developed alongside each other,
// dynamic linking is the better default; static libc may contain code that requires
// the very latest kernel version.
- if (target.isFreeBSDLibC()) {
+ if (target.isFreeBSDLibC() or target.isNetBSDLibC()) {
break :b .dynamic;
}
}