| author | |
| committer | |
| log | 7cd6c25c8fd21bc984814b7051e7fea6fe446cfb |
| tree | 3cb22838007e304499b0d428f46f1e08f2d63003 |
| parent | 8a2ab60fca405d97d2d86456c92db1e5606622e4 |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
* 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 { | ... | @@ -168,6 +168,9 @@ pub fn build(b: *Builder) !void { |
| 168 | } else if (exe.target.isFreeBSD()) { | 168 | } else if (exe.target.isFreeBSD()) { |
| 169 | try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes); | 169 | try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes); |
| 170 | exe.linkSystemLibrary("pthread"); | 170 | 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); | ||
| 171 | } else if (exe.target.isDarwin()) { | 174 | } else if (exe.target.isDarwin()) { |
| 172 | if (addCxxKnownPath(b, cfg, exe, "libgcc_eh.a", "", need_cpp_includes)) { | 175 | if (addCxxKnownPath(b, cfg, exe, "libgcc_eh.a", "", need_cpp_includes)) { |
| 173 | // Compiler is GCC. | 176 | // Compiler is GCC. |
src/link/Elf.zig+1-1| ... | @@ -1584,7 +1584,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { | ... | @@ -1584,7 +1584,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { |
| 1584 | try argv.append("-lm"); | 1584 | try argv.append("-lm"); |
| 1585 | } | 1585 | } |
| 1586 | 1586 | ||
| 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) { |
| 1588 | try argv.append("-lpthread"); | 1588 | try argv.append("-lpthread"); |
| 1589 | } | 1589 | } |
| 1590 | } else if (target.isGnuLibC()) { | 1590 | } else if (target.isGnuLibC()) { |