[lld] 0a78e42 - Revert "[lld] Remove special cases from default ld driver mode."

Dan Albert via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 14:15:21 PDT 2020


Author: Dan Albert
Date: 2020-04-29T14:14:51-07:00
New Revision: 0a78e42b1f9d4b49d2b072c953e465d5a9666005

URL: https://github.com/llvm/llvm-project/commit/0a78e42b1f9d4b49d2b072c953e465d5a9666005
DIFF: https://github.com/llvm/llvm-project/commit/0a78e42b1f9d4b49d2b072c953e465d5a9666005.diff

LOG: Revert "[lld] Remove special cases from default ld driver mode."

This reverts commit da093c388fc9a559295faa6265cb8b1643ce9eeb.

Broke a test on Darwin. Will fix the test and resubmit.

Added: 
    

Modified: 
    lld/tools/lld/lld.cpp

Removed: 
    


################################################################################
diff  --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp
index 8a8f8d04bbda..58a291d1e921 100644
--- a/lld/tools/lld/lld.cpp
+++ b/lld/tools/lld/lld.cpp
@@ -96,9 +96,17 @@ static bool isPETarget(std::vector<const char *> &v) {
 }
 
 static Flavor parseProgname(StringRef progname) {
-  // Use GNU driver for "ld" by default.
+#if __APPLE__
+  // Use Darwin driver for "ld" on Darwin.
+  if (progname == "ld")
+    return Darwin;
+#endif
+
+#if LLVM_ON_UNIX
+  // Use GNU driver for "ld" on other Unix-like system.
   if (progname == "ld")
     return Gnu;
+#endif
 
   // Progname may be something like "lld-gnu". Parse it.
   SmallVector<StringRef, 3> v;


        


More information about the llvm-commits mailing list