diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-05-13 01:49:45 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-05-17 20:12:56 +0200 |
| commit | a97e417ab1e555d14e6d76df722de92cca85ba2f (patch) | |
| tree | 240a553938a0fdebf5984b6f4cdcc498464abcef /src/link/Elf.zig | |
| parent | c5e669ff768857df3cfab774318938ddfc254b90 (diff) | |
| download | zig-a97e417ab1e555d14e6d76df722de92cca85ba2f.tar.gz zig-a97e417ab1e555d14e6d76df722de92cca85ba2f.zip | |
compiler: Support building NetBSD crt1.o/Scrt1.o and stub shared libraries.
Only works for NetBSD 10.1+. Note that we still default to targeting NetBSD 9.
Contributes to #2877.
Diffstat (limited to 'src/link/Elf.zig')
| -rw-r--r-- | src/link/Elf.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/link/Elf.zig b/src/link/Elf.zig index df91771ecf..af37655520 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -2070,6 +2070,13 @@ fn linkWithLLD(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: s }); try argv.append(lib_path); } + } else if (target.isNetBSDLibC()) { + for (netbsd.libs) |lib| { + const lib_path = try std.fmt.allocPrint(arena, "{}{c}lib{s}.so.{d}", .{ + comp.netbsd_so_files.?.dir_path, fs.path.sep, lib.name, lib.sover, + }); + try argv.append(lib_path); + } } else { diags.flags.missing_libc = true; } @@ -5289,6 +5296,7 @@ const gc = @import("Elf/gc.zig"); const glibc = @import("../libs/glibc.zig"); const musl = @import("../libs/musl.zig"); const freebsd = @import("../libs/freebsd.zig"); +const netbsd = @import("../libs/netbsd.zig"); const link = @import("../link.zig"); const relocatable = @import("Elf/relocatable.zig"); const relocation = @import("Elf/relocation.zig"); |
