mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
haiku: fix linking issues
This commit is contained in:
parent
0c83fa2fd0
commit
fcdb7027e9
4 changed files with 22 additions and 2 deletions
|
|
@ -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("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
|
||||||
try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{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 => {},
|
else => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2740,6 +2740,13 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,13 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths {
|
||||||
return self;
|
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) {
|
if (builtin.os.tag != .windows and builtin.os.tag != .wasi) {
|
||||||
const triple = try native_target.linuxTriple(arena);
|
const triple = try native_target.linuxTriple(arena);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1517,7 +1517,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void {
|
||||||
|
|
||||||
if (self.base.isStatic()) {
|
if (self.base.isStatic()) {
|
||||||
try argv.append("-static");
|
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");
|
try argv.append("-shared");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2469,7 +2469,10 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: *std.Progress.Node) !voi
|
||||||
} else {
|
} else {
|
||||||
try argv.append("-static");
|
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");
|
try argv.append("-shared");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue