Commit 4c30216d1c

Andrew Kelley <superjoe30@gmail.com>
2016-02-16 05:23:03
add missing system library to darwin linker job
1 parent 984e7d6
Changed files (1)
src/link.cpp
@@ -605,6 +605,20 @@ static void construct_linker_job_darwin(LinkJob *lj) {
         lj->args.append(buf_ptr(arg));
     }
 
+    if (g->link_libc) {
+        lj->args.append("-lSystem");
+
+        if (platform.kind == MacOS) {
+            if (darwin_version_lt(&platform, 10, 5)) {
+                lj->args.append("-lgcc_s.10.4");
+            } else if (darwin_version_lt(&platform, 10, 6)) {
+                lj->args.append("-lgcc_s.10.5");
+            }
+        } else {
+            zig_panic("TODO");
+        }
+    }
+
 }
 
 static void construct_linker_job(LinkJob *lj) {