diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-13 23:44:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-13 23:44:38 -0400 |
| commit | 862ac42a6e1414d3109ec309d36000a8f22821eb (patch) | |
| tree | 695ce1112530e709a6baf2a679020e4f39d7d6cd /src/link.cpp | |
| parent | 927efe5f4251382ced866870de4ac50ed14d72d3 (diff) | |
| download | zig-862ac42a6e1414d3109ec309d36000a8f22821eb.tar.gz zig-862ac42a6e1414d3109ec309d36000a8f22821eb.zip | |
ignore -lm on darwin because it's handled by libSystem
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/link.cpp b/src/link.cpp index 1fc3ad91e4..3e71d84902 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -1526,15 +1526,15 @@ static void construct_linker_job_macho(LinkJob *lj) { if (g->zig_target->is_native) { for (size_t lib_i = 0; lib_i < g->link_libs_list.length; lib_i += 1) { LinkLib *link_lib = g->link_libs_list.at(lib_i); - if (buf_eql_str(link_lib->name, "c")) { + if (target_is_libc_lib_name(g->zig_target, buf_ptr(link_lib->name))) { + // handled by libSystem continue; + } + if (strchr(buf_ptr(link_lib->name), '/') == nullptr) { + Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name)); + lj->args.append(buf_ptr(arg)); } else { - if (strchr(buf_ptr(link_lib->name), '/') == nullptr) { - Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name)); - lj->args.append(buf_ptr(arg)); - } else { - lj->args.append(buf_ptr(link_lib->name)); - } + lj->args.append(buf_ptr(link_lib->name)); } } // on Darwin, libSystem has libc in it, but also you have to use it |
