[PATCH] D78328: [lld] Infer the driver mode from the target.

Dan Albert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 15:04:57 PDT 2020


danalbert marked an inline comment as done.
danalbert added inline comments.


================
Comment at: lld/tools/lld/lld.cpp:134
+  // Deduce the flavor from the target.
+  if (targetMatches(v, [](StringRef s) {
+        return s.contains("linux") || s.contains("elf");
----------------
MaskRay wrote:
> This checks `-m` for lld-link, wasm-ld and ld64 which not be great.
> 
> We can place the check inside:
> ```
> #if __APPLE__
>   // Use Darwin driver for "ld" on Darwin.
>   if (progname == "ld")
>     return Darwin;
> #endif
> ```
Okay, if we don't want this behavior to affect non-Android targets I think the Clang patch is the right answer.

Although removing the Darwin case also SGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78328





More information about the llvm-commits mailing list