haiku: fix linking issues

This commit is contained in:
Jacob Young
2024-04-07 21:19:12 -04:00
parent 0c83fa2fd0
commit fcdb7027e9
4 changed files with 22 additions and 2 deletions

View File

@@ -1517,7 +1517,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void {
if (self.base.isStatic()) {
try argv.append("-static");
} else if (self.base.isDynLib()) {
} else if (self.base.isDynLib() or (target.os.tag == .haiku and self.base.isExe())) {
try argv.append("-shared");
}
@@ -2469,7 +2469,10 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: *std.Progress.Node) !voi
} else {
try argv.append("-static");
}
} else if (is_dyn_lib) {
} else if (switch (target.os.tag) {
else => is_dyn_lib,
.haiku => is_exe_or_dyn_lib,
}) {
try argv.append("-shared");
}