freebsd: link against libc++

All supported versions of FreeBSD have libc++ in the base system.
This commit is contained in:
Marcio Giaxa 2018-12-18 00:19:52 -02:00
parent 1fc56b82ad
commit 6cfcdbde2b

View File

@ -293,11 +293,17 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void {
try addCxxKnownPath(b, ctx, exe, "libstdc++.a",
\\Unable to determine path to libstdc++.a
\\On Fedora, install libstdc++-static and try again.
\\
);
exe.linkSystemLibrary("pthread");
} else if (exe.target.isDarwin() or exe.target.isFreeBSD()) {
} else if (exe.target.isFreeBSD()) {
try addCxxKnownPath(b, ctx, exe, "libc++.a", null);
exe.linkSystemLibrary("pthread");
// TODO LLD cannot perform this link.
// See https://github.com/ziglang/zig/issues/1535
exe.enableSystemLinkerHack();
}
else if (exe.target.isDarwin()) {
if (addCxxKnownPath(b, ctx, exe, "libgcc_eh.a", "")) {
// Compiler is GCC.
try addCxxKnownPath(b, ctx, exe, "libstdc++.a", null);