Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
futurejones authored Mar 1, 2024
1 parent 3e89014 commit b4be93b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test-patches/amazonlinux-lld-UnixToolchains.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/lib/Driver/UnixToolChains.cpp b/lib/Driver/UnixToolChains.cpp
index 61498c144a2..f1952d57620 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";
+ return "lld";
+ }

switch (getTriple().getArch()) {
case llvm::Triple::arm:

0 comments on commit b4be93b

Please sign in to comment.