authorgravatar for semarie@users.noreply.github.comSebastien Marie <semarie@users.noreply.github.com> 2020-12-15 20:45:48+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-12-15 14:45:48-05:00
log7cd6c25c8fd21bc984814b7051e7fea6fe446cfb
tree3cb22838007e304499b0d428f46f1e08f2d63003
parent8a2ab60fca405d97d2d86456c92db1e5606622e4
signature Signed by PGP key 4AEE18F83AFDEB23

openbsd: link with required system libraries (#7380)

* openbsd: use -lpthread when linking and while compiling zig stage2, use c++ and c++abi too

2 files changed, 4 insertions(+), 1 deletions(-)

build.zig+3
......@@ -168,6 +168,9 @@ pub fn build(b: *Builder) !void {
168168 } else if (exe.target.isFreeBSD()) {
169169 try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes);
170170 exe.linkSystemLibrary("pthread");
171 } else if (exe.target.getOsTag() == .openbsd) {
172 try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes);
173 try addCxxKnownPath(b, cfg, exe, "libc++abi.a", null, need_cpp_includes);
171174 } else if (exe.target.isDarwin()) {
172175 if (addCxxKnownPath(b, cfg, exe, "libgcc_eh.a", "", need_cpp_includes)) {
173176 // Compiler is GCC.
src/link/Elf.zig+1-1
......@@ -1584,7 +1584,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
15841584 try argv.append("-lm");
15851585 }
15861586
1587 if (target.os.tag == .freebsd or target.os.tag == .netbsd) {
1587 if (target.os.tag == .freebsd or target.os.tag == .netbsd or target.os.tag == .openbsd) {
15881588 try argv.append("-lpthread");
15891589 }
15901590 } else if (target.isGnuLibC()) {