blob: b79d338f57a76c9361ed4d6fe40baa757aabeef4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# Swift defaults to building with `gold` on Linux because `bfd` can't correctly
# handle Swift symbols; Gentoo no longer supports `gold`, so we have to make
# sure that we build with `lld`.
--- a/swift/lib/Driver/UnixToolChains.cpp
+++ b/swift/lib/Driver/UnixToolChains.cpp
@@ -109,36 +109,7 @@ ToolChain::InvocationInfo toolchains::GenericUnix::constructInvocation(
return II;
}
-std::string toolchains::GenericUnix::getDefaultLinker() const {
- if (getTriple().isAndroid()
- || (getTriple().isMusl()
- && getTriple().getVendor() == llvm::Triple::Swift))
- return "lld";
-
- switch (getTriple().getArch()) {
- case llvm::Triple::arm:
- case llvm::Triple::aarch64:
- case llvm::Triple::aarch64_32:
- case llvm::Triple::armeb:
- case llvm::Triple::thumb:
- case llvm::Triple::thumbeb:
- // BFD linker has issues wrt relocation of the protocol conformance
- // section on these targets, it also generates COPY relocations for
- // final executables, as such, unless specified, we default to gold
- // linker.
- return "gold";
- case llvm::Triple::x86:
- case llvm::Triple::x86_64:
- case llvm::Triple::ppc64:
- case llvm::Triple::ppc64le:
- case llvm::Triple::systemz:
- // BFD linker has issues wrt relocations against protected symbols.
- return "gold";
- default:
- // Otherwise, use the default BFD linker.
- return "";
- }
-}
+std::string toolchains::GenericUnix::getDefaultLinker() const { return "lld"; }
bool toolchains::GenericUnix::addRuntimeRPath(const llvm::Triple &T,
const llvm::opt::ArgList &Args) const {
|