mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 14:24:43 +00:00
openbsd: link with required system libraries (#7380)
* openbsd: use -lpthread when linking and while compiling zig stage2, use c++ and c++abi too
This commit is contained in:
parent
8a2ab60fca
commit
7cd6c25c8f
2 changed files with 4 additions and 1 deletions
|
|
@ -168,6 +168,9 @@ pub fn build(b: *Builder) !void {
|
||||||
} else if (exe.target.isFreeBSD()) {
|
} else if (exe.target.isFreeBSD()) {
|
||||||
try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes);
|
try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes);
|
||||||
exe.linkSystemLibrary("pthread");
|
exe.linkSystemLibrary("pthread");
|
||||||
|
} else if (exe.target.getOsTag() == .openbsd) {
|
||||||
|
try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes);
|
||||||
|
try addCxxKnownPath(b, cfg, exe, "libc++abi.a", null, need_cpp_includes);
|
||||||
} else if (exe.target.isDarwin()) {
|
} else if (exe.target.isDarwin()) {
|
||||||
if (addCxxKnownPath(b, cfg, exe, "libgcc_eh.a", "", need_cpp_includes)) {
|
if (addCxxKnownPath(b, cfg, exe, "libgcc_eh.a", "", need_cpp_includes)) {
|
||||||
// Compiler is GCC.
|
// Compiler is GCC.
|
||||||
|
|
|
||||||
|
|
@ -1584,7 +1584,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
|
||||||
try argv.append("-lm");
|
try argv.append("-lm");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.os.tag == .freebsd or target.os.tag == .netbsd) {
|
if (target.os.tag == .freebsd or target.os.tag == .netbsd or target.os.tag == .openbsd) {
|
||||||
try argv.append("-lpthread");
|
try argv.append("-lpthread");
|
||||||
}
|
}
|
||||||
} else if (target.isGnuLibC()) {
|
} else if (target.isGnuLibC()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue