zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6cfcdbde2b902476863cb912190f20ce5e02277c (tree)
parent 1fc56b82ad6f1060ec4b2074c16accfe0327a4b7
Author: Marcio Giaxa <i@mgxm.me>
Date:   Tue, 18 Dec 2018 00:19:52 -0200

freebsd: link against libc++

All supported versions of FreeBSD have libc++ in the base system.

Diffstat:
Mbuild.zig | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/build.zig b/build.zig @@ -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);