mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
haiku: fix linking issues
This commit is contained in:
parent
0c83fa2fd0
commit
fcdb7027e9
@ -747,6 +747,9 @@ fn addCmakeCfgOptionsToExe(
|
||||
try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
|
||||
try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
|
||||
},
|
||||
.haiku => {
|
||||
try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
|
||||
@ -2740,6 +2740,13 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (target.os.tag == .haiku) {
|
||||
if (eqlIgnoreCase(ignore_case, name, "root"))
|
||||
return true;
|
||||
if (eqlIgnoreCase(ignore_case, name, "network"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -105,6 +105,13 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths {
|
||||
return self;
|
||||
}
|
||||
|
||||
if (builtin.os.tag == .haiku) {
|
||||
try self.addLibDir("/system/non-packaged/lib");
|
||||
try self.addLibDir("/system/develop/lib");
|
||||
try self.addLibDir("/system/lib");
|
||||
return self;
|
||||
}
|
||||
|
||||
if (builtin.os.tag != .windows and builtin.os.tag != .wasi) {
|
||||
const triple = try native_target.linuxTriple(arena);
|
||||
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user