commit 533e2671c9f5ee29d4a42bfb6faad651eef00bc0 (tree)
parent eb5276c94eaab238551fdae9a2e77b0133e31cfb
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Tue, 17 Oct 2023 23:23:33 +0200
elf: add native libc* system libraries to the invocation
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/link/Elf.zig b/src/link/Elf.zig
@@ -1383,8 +1383,15 @@ pub fn flushModule(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node
// libc dep
self.error_flags.missing_libc = false;
if (self.base.options.link_libc) {
- if (self.base.options.libc_installation != null) {
- @panic("TODO explicit libc_installation");
+ if (self.base.options.libc_installation) |lc| {
+ const flags = target_util.libcFullLinkFlags(target);
+ try system_libs.ensureUnusedCapacity(flags.len);
+ for (flags) |flag| {
+ const lib_path = try std.fmt.allocPrint(arena, "{s}{c}lib{s}.so", .{
+ lc.crt_dir.?, fs.path.sep, flag["-l".len..],
+ });
+ system_libs.appendAssumeCapacity(.{ .path = lib_path });
+ }
} else if (target.isGnuLibC()) {
try system_libs.ensureUnusedCapacity(glibc.libs.len + 1);
for (glibc.libs) |lib| {