macho linking: support full lib paths correctly

This commit is contained in:
Andrew Kelley 2017-09-23 13:03:25 -04:00
parent 10fa51a085
commit d71d6363ce

View File

@ -757,8 +757,12 @@ static void construct_linker_job_macho(LinkJob *lj) {
// so we always link against libSystem
lj->args.append("-lSystem");
} else {
Buf *arg = buf_sprintf("-l%s", buf_ptr(link_lib->name));
lj->args.append(buf_ptr(arg));
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));
}
}
}
} else {