From 415c0cd698a8f0784172d19d542a3b525d1bb9b0 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Mon, 1 Mar 2021 12:30:10 -0500 Subject: [lld-macho] Switch default to new Darwin backend The new Darwin backend for LLD is now able to link reasonably large real-world programs on x86_64. For instance, we have achieved self-hosting for the X86_64 target, where all LLD tests pass when building lld with itself on macOS. As such, we would like to make it the default back-end. The new port is now named `ld64.lld`, and the old port remains accessible as `ld64.lld.darwinold` This [annoucement email][1] has some context. (But note that, unlike what the email says, we are no longer doing this as part of the LLVM 12 branch cut -- instead we will go into LLVM 13.) Numerous mechanical test changes were required to make this change; in the interest of creating something that's reviewable on Phabricator, I've split out the boring changes into a separate diff (D95905). I plan to merge its contents with those in this diff before landing. (@gkm made the original draft of this diff, and he has agreed to let me take over.) [1]: https://lists.llvm.org/pipermail/llvm-dev/2021-January/147665.html Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D95204 --- lld/tools/lld/CMakeLists.txt | 2 +- lld/tools/lld/lld.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'lld/tools') diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt index 5cff736..e77b216 100644 --- a/lld/tools/lld/CMakeLists.txt +++ b/lld/tools/lld/CMakeLists.txt @@ -25,7 +25,7 @@ install(TARGETS lld if(NOT LLD_SYMLINKS_TO_CREATE) set(LLD_SYMLINKS_TO_CREATE - lld-link ld.lld ld64.lld ld64.lld.darwinnew wasm-ld) + lld-link ld.lld ld64.lld ld64.lld.darwinnew ld64.lld.darwinold wasm-ld) endif() foreach(link ${LLD_SYMLINKS_TO_CREATE}) diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp index 77d7792..01605bc 100644 --- a/lld/tools/lld/lld.cpp +++ b/lld/tools/lld/lld.cpp @@ -56,7 +56,7 @@ enum Flavor { Gnu, // -flavor gnu WinLink, // -flavor link Darwin, // -flavor darwin - DarwinNew, // -flavor darwinnew + DarwinOld, // -flavor darwinold Wasm, // -flavor wasm }; @@ -70,8 +70,9 @@ static Flavor getFlavor(StringRef s) { .CasesLower("ld", "ld.lld", "gnu", Gnu) .CasesLower("wasm", "ld-wasm", Wasm) .CaseLower("link", WinLink) - .CasesLower("ld64", "ld64.lld", "darwin", Darwin) - .CasesLower("darwinnew", "ld64.lld.darwinnew", DarwinNew) + .CasesLower("ld64", "ld64.lld", "darwin", "darwinnew", + "ld64.lld.darwinnew", Darwin) + .CasesLower("darwinold", "ld64.lld.darwinold", DarwinOld) .Default(Invalid); } @@ -154,9 +155,9 @@ static int lldMain(int argc, const char **argv, llvm::raw_ostream &stdoutOS, case WinLink: return !coff::link(args, exitEarly, stdoutOS, stderrOS); case Darwin: - return !mach_o::link(args, exitEarly, stdoutOS, stderrOS); - case DarwinNew: return !macho::link(args, exitEarly, stdoutOS, stderrOS); + case DarwinOld: + return !mach_o::link(args, exitEarly, stdoutOS, stderrOS); case Wasm: return !lld::wasm::link(args, exitEarly, stdoutOS, stderrOS); default: -- cgit v1.1