-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4be93b
commit ea01bb8
Showing
1 changed file
with
17 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,21 @@ | ||
diff --git a/lib/Driver/UnixToolChains.cpp b/lib/Driver/UnixToolChains.cpp | ||
index 61498c144a2..f1952d57620 100644 | ||
index 61498c144a2..f9f540ec144 100644 | ||
--- a/lib/Driver/UnixToolChains.cpp | ||
+++ b/lib/Driver/UnixToolChains.cpp | ||
@@ -10,6 +10,9 @@ | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
+#include <iostream> | ||
+#include "llvm/TargetParser/Triple.h" | ||
+ | ||
#include "ToolChains.h" | ||
|
||
#include "swift/Basic/Dwarf.h" | ||
@@ -111,8 +114,23 @@ ToolChain::InvocationInfo toolchains::GenericUnix::constructInvocation( | ||
} | ||
|
||
std::string toolchains::GenericUnix::getDefaultLinker() const { | ||
+ std::cout << "We need to check for Amazon Linux and set default to lld\n"; | ||
+ std::cout << "getTriple().getArch(): " << getTriple().getArch() << std::endl; | ||
+ std::cout << "getTriple().getVendorName(): " << getTriple().getVendorName() << std::endl; | ||
+ std::cout << "getTriple().isAndroid(): " << getTriple().isAndroid() << std::endl; | ||
+ std::cout << "getTriple().getArchName(): " << getTriple().getArchName() << std::endl; | ||
+ std::cout << "getTriple().getOSName(): " << getTriple().getOSName() << std::endl; | ||
+ std::cout << "getTriple().getOS(): " << getTriple().getOS() << std::endl; | ||
+ std::cout << "getTriple().getOSMajorVersion(): " << getTriple().getOSMajorVersion() << std::endl; | ||
+ std::cout << "getTriple().getOSMinorVersion(): " << getTriple().getOSMinorVersion() << std::endl; | ||
+ | ||
if (getTriple().isAndroid()) | ||
return "lld"; | ||
+ // Check for Amazon Linux and default to lld | ||
+ if (getTriple().getVendorName() == "amazon") { | ||
+ std::cout << "We are using Amazon Linux so default to lld\n"; | ||
@@ -125,14 +125,14 @@ std::string toolchains::GenericUnix::getDefaultLinker() const { | ||
// section on these targets, it also generates COPY relocations for | ||
// final executables, as such, unless specified, we default to gold | ||
// linker. | ||
- return "gold"; | ||
+ return "lld"; | ||
+ } | ||
|
||
switch (getTriple().getArch()) { | ||
case llvm::Triple::arm: | ||
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"; | ||
+ return "lld"; | ||
default: | ||
// Otherwise, use the default BFD linker. | ||
return ""; |