From 0a78e42b1f9d4b49d2b072c953e465d5a9666005 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 29 Apr 2020 14:14:51 -0700 Subject: [PATCH] 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. --- lld/tools/lld/lld.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp index 8a8f8d0..58a291d 100644 --- a/lld/tools/lld/lld.cpp +++ b/lld/tools/lld/lld.cpp @@ -96,9 +96,17 @@ static bool isPETarget(std::vector &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 v; -- 2.7.4