From d71d6363ce15b7bb7b66efad2cb62dfa79045e80 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 23 Sep 2017 13:03:25 -0400 Subject: [PATCH] macho linking: support full lib paths correctly --- src/link.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/link.cpp b/src/link.cpp index 0ee0b49d01..39cadaea0f 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -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 {