Skip to content

Commit

Permalink
backout 08a81b9: the linked binary do not run (uncaught exception wit…
Browse files Browse the repository at this point in the history
…h cxa default handlers)
  • Loading branch information
semarie committed Oct 10, 2020
1 parent e90e805 commit c8df4d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 0 additions & 6 deletions build.zig
Expand Up @@ -390,12 +390,6 @@ fn configureStage2(b: *Builder, exe: anytype, ctx: Context, need_cpp_includes: b
} else if (exe.target.isFreeBSD()) {
try addCxxKnownPath(b, ctx, exe, "libc++.a", null, need_cpp_includes);
exe.linkSystemLibrary("pthread");
} else if (exe.target.isOpenBSD()) {
// XXX libc++.a/libc++abi.a isn't the right stdc++ library
// on all archs on OpenBSD
try addCxxKnownPath(b, ctx, exe, "libc++.a", null, need_cpp_includes);
try addCxxKnownPath(b, ctx, exe, "libc++abi.a", null, need_cpp_includes);
try addCxxKnownPath(b, ctx, exe, "libpthread.a", null, need_cpp_includes);
} else if (exe.target.isDarwin()) {
if (addCxxKnownPath(b, ctx, exe, "libgcc_eh.a", "", need_cpp_includes)) {
// Compiler is GCC.
Expand Down
3 changes: 3 additions & 0 deletions src/link/Elf.zig
Expand Up @@ -1576,6 +1576,9 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {

if (target.os.tag == .openbsd) {
try argv.append("-lcompiler_rt");
try argv.append("-lc++abi");
try argv.append("-lc++");
try argv.append("-lpthread");
}
} else if (target.isGnuLibC()) {
try argv.append(comp.libunwind_static_lib.?.full_object_path);
Expand Down

0 comments on commit c8df4d9

Please sign in to comment.