aboutsummaryrefslogtreecommitdiff
path: root/lld/tools
diff options
context:
space:
mode:
authorJez Ng <jezng@fb.com>2021-03-01 12:30:10 -0500
committerJez Ng <jezng@fb.com>2021-03-01 12:30:10 -0500
commit415c0cd698a8f0784172d19d542a3b525d1bb9b0 (patch)
treefd591b461522d059cb9e02508bfc53b32d76d11d /lld/tools
parentf083f652c3fdc97e0bda278fee8354a0cf7ff551 (diff)
downloadllvm-415c0cd698a8f0784172d19d542a3b525d1bb9b0.zip
llvm-415c0cd698a8f0784172d19d542a3b525d1bb9b0.tar.gz
llvm-415c0cd698a8f0784172d19d542a3b525d1bb9b0.tar.bz2
[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
Diffstat (limited to 'lld/tools')
-rw-r--r--lld/tools/lld/CMakeLists.txt2
-rw-r--r--lld/tools/lld/lld.cpp11
2 files changed, 7 insertions, 6 deletions
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: