Commit d71d6363ce

Andrew Kelley <superjoe30@gmail.com>
2017-09-23 19:03:25
macho linking: support full lib paths correctly
1 parent 10fa51a
Changed files (1)
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 {