aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcio Giaxa <i@mgxm.me>2018-12-18 00:19:20 -0200
committerMarcio Giaxa <i@mgxm.me>2018-12-19 18:42:00 -0200
commit1fc56b82ad6f1060ec4b2074c16accfe0327a4b7 (patch)
tree612f85682f05eb5296be5013f6e88769ee8c1215 /src
parent0273fbf710f98854f3331c0810cd2f31f20d2fb5 (diff)
downloadzig-1fc56b82ad6f1060ec4b2074c16accfe0327a4b7.tar.gz
zig-1fc56b82ad6f1060ec4b2074c16accfe0327a4b7.zip
freebsd: link against libc
Since the stable kernel ABI is through libc #1759
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp2
-rw-r--r--src/codegen.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 46686ce772..064cf11cc1 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6366,7 +6366,7 @@ LinkLib *add_link_lib(CodeGen *g, Buf *name) {
if (is_libc && g->libc_link_lib != nullptr)
return g->libc_link_lib;
- if (g->enable_cache && is_libc && g->zig_target.os != OsMacOSX && g->zig_target.os != OsIOS) {
+ if (g->enable_cache && is_libc && g->zig_target.os != OsMacOSX && g->zig_target.os != OsIOS && g->zig_target.os != OsFreeBSD) {
fprintf(stderr, "TODO linking against libc is currently incompatible with `--cache on`.\n"
"Zig is not yet capable of determining whether the libc installation has changed on subsequent builds.\n");
exit(1);
diff --git a/src/codegen.cpp b/src/codegen.cpp
index e37703d5f0..e2d23513ff 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -178,7 +178,8 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out
// On Darwin/MacOS/iOS, we always link libSystem which contains libc.
if (g->zig_target.os == OsMacOSX ||
- g->zig_target.os == OsIOS)
+ g->zig_target.os == OsIOS ||
+ g->zig_target.os == OsFreeBSD)
{
g->libc_link_lib = create_link_lib(buf_create_from_str("c"));
g->link_libs_list.append(g->libc_link_lib);