[PATCH] D76252: [lld-macho] Add basic support for linking against dylibs

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 16:50:33 PDT 2020


smeenai accepted this revision.
smeenai added a comment.
This revision is now accepted and ready to land.

LGTM with the comments addressed. I can commit this for you once they are.



================
Comment at: lld/MachO/Driver.cpp:91-92
+  std::vector<StringRef> ret;
+  if (!args.hasArg(OPT_Z))
+    ret = {"/usr/lib", "/usr/local/lib"};
+  for (StringRef s : args::getStrings(args, OPT_L))
----------------
I believe these should actually be placed on the search path *after* any user-specified `-L` directories. At least that's what ld64 appears to do, based on the output from its `-v` option.


================
Comment at: lld/MachO/InputSection.cpp:34
+      }
+    } else if (auto *isec = r.target.dyn_cast<InputSection *>())
       va = isec->addr;
----------------
Nit: when one branch of an if-else has braces, all the others should too.


================
Comment at: lld/MachO/InputSection.cpp:36
       va = isec->addr;
     else
       llvm_unreachable("Unknown relocation target");
----------------
(same here)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76252/new/

https://reviews.llvm.org/D76252





More information about the llvm-commits mailing list