Blame patches/clang_host/clang-0004-Add-musl-targets-and-dynamic-linker.patch

Lucio Andrés Illanes Albornoz (arab, vxp) 585426
From 4777c16fc6e717a852366fa2a447c852cca3b62d Mon Sep 17 00:00:00 2001
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
From: Natanael Copa <ncopa@alpinelinux.org>
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
Date: Fri, 19 Feb 2016 13:35:08 +0100
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
Subject: [PATCH 4/7] Add musl targets and dynamic linker
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
---
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 lib/Basic/Targets.cpp      |  2 ++
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 lib/CodeGen/TargetInfo.cpp |  6 +++++-
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 lib/Driver/ToolChains.cpp  | 15 ++++++++++-----
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 lib/Driver/Tools.cpp       | 44 +++++++++++++++++++++++++++++++++++++++++++-
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 4 files changed, 60 insertions(+), 7 deletions(-)
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
index af8aea0..1e27c7a 100644
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
--- a/lib/Basic/Targets.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+++ b/lib/Basic/Targets.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -4513,6 +4513,8 @@ public:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::Android:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+      case llvm::Triple::MuslEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+      case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         setABI("aapcs-linux");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
index 3d1ddef..f6b3474 100644
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
--- a/lib/CodeGen/TargetInfo.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+++ b/lib/CodeGen/TargetInfo.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -4757,6 +4757,8 @@ public:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       return true;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     default:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       return false;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -4767,6 +4769,7 @@ public:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     switch (getTarget().getTriple().getEnvironment()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       return true;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     default:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       return false;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -7492,7 +7495,8 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         Kind = ARMABIInfo::AAPCS16_VFP;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       else if (CodeGenOpts.FloatABI == "hard" ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
                (CodeGenOpts.FloatABI != "soft" &&
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-                Triple.getEnvironment() == llvm::Triple::GNUEABIHF))
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+                (Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+                 Triple.getEnvironment() == llvm::Triple::MuslEABIHF)))
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         Kind = ARMABIInfo::AAPCS_VFP;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       return *(TheTargetCodeGenInfo = new ARMTargetCodeGenInfo(Types, Kind));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
index 6b0b31d..0db9644 100644
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
--- a/lib/Driver/ToolChains.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+++ b/lib/Driver/ToolChains.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -1523,7 +1523,8 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::arm:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::thumb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+        TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       TripleAliases.append(begin(ARMHFTriples), end(ARMHFTriples));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     } else {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       TripleAliases.append(begin(ARMTriples), end(ARMTriples));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -1532,7 +1533,8 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::armeb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::thumbeb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     LibDirs.append(begin(ARMebLibDirs), end(ARMebLibDirs));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+        TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       TripleAliases.append(begin(ARMebHFTriples), end(ARMebHFTriples));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     } else {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       TripleAliases.append(begin(ARMebTriples), end(ARMebTriples));
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -3528,7 +3530,8 @@ static std::string getMultiarchTriple(const Driver &D,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   // regardless of what the actual target triple is.
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::arm:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::thumb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    if (TargetEnvironment == llvm::Triple::GNUEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    if (TargetEnvironment == llvm::Triple::GNUEABIHF ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+        TargetEnvironment == llvm::Triple::MuslEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       if (D.getVFS().exists(SysRoot + "/lib/arm-linux-gnueabihf"))
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         return "arm-linux-gnueabihf";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     } else {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -3538,7 +3541,8 @@ static std::string getMultiarchTriple(const Driver &D,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::armeb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::thumbeb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    if (TargetEnvironment == llvm::Triple::GNUEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    if (TargetEnvironment == llvm::Triple::GNUEABIHF ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+        TargetEnvironment == llvm::Triple::MuslEABIHF) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       if (D.getVFS().exists(SysRoot + "/lib/armeb-linux-gnueabihf"))
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         return "armeb-linux-gnueabihf";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     } else {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -3969,7 +3973,8 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::arm:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   case llvm::Triple::thumb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-    if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF ||
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+        getTriple().getEnvironment() == llvm::Triple::MuslEABIHF)
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       MultiarchIncludeDirs = ARMHFMultiarchIncludeDirs;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     else
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       MultiarchIncludeDirs = ARMMultiarchIncludeDirs;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
index b7ac24f..ea1ce6f 100644
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
--- a/lib/Driver/Tools.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+++ b/lib/Driver/Tools.cpp
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -712,6 +712,7 @@ arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::FreeBSD:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       switch (Triple.getEnvironment()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+      case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         ABI = FloatABI::Hard;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       default:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -725,6 +726,7 @@ arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       switch (Triple.getEnvironment()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+      case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         ABI = FloatABI::Hard;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
         break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -968,6 +970,8 @@ void Clang::AddARMTargetArgs(const llvm::Triple &Triple, const ArgList &Args,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::Android:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       ABIName = "aapcs-linux";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -7857,6 +7861,8 @@ void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     switch (getToolChain().getTriple().getEnvironment()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       CmdArgs.push_back("-meabi=5");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -8199,10 +8205,12 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     switch (getToolChain().getTriple().getEnvironment()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       CmdArgs.push_back("armelf_nbsd_eabi");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       CmdArgs.push_back("armelf_nbsd_eabihf");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     default:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -8219,10 +8227,12 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     switch (getToolChain().getTriple().getEnvironment()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABI:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       CmdArgs.push_back("armelfb_nbsd_eabi");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::EABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     case llvm::Triple::GNUEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    case llvm::Triple::MuslEABIHF:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       CmdArgs.push_back("armelfb_nbsd_eabihf");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       break;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     default:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
@@ -8623,11 +8633,43 @@ static void AddLibgcc(const llvm::Triple &Triple, const Driver &D,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     CmdArgs.push_back("-ldl");
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 }
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+static std::string getMuslDynamicLinker(const llvm::Triple::ArchType Arch,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+                                        const llvm::Triple::EnvironmentType Env) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  switch (Arch) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::arm:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::thumb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return Env == llvm::Triple::MuslEABIHF ?
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+           "/lib/ld-musl-armhf.so.1" : "/lib/ld-musl-arm.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::armeb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::thumbeb:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return Env == llvm::Triple::MuslEABIHF ?
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+           "/lib/ld-musl-armebhf.so.1" : "/lib/ld-musl-armeb.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::aarch64:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-aarch64.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::aarch64_be:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-aarch64_be.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::mips:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-mips.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::mipsel:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-mipsel.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::ppc:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-powerpc.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  case llvm::Triple::x86:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-i386.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+//case llvm::Triple::x86_64:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  default:
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return "/lib/ld-musl-x86_64.so.1";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  }
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  return NULL;
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+}
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 static std::string getLinuxDynamicLinker(const ArgList &Args,
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
                                          const toolchains::Linux &ToolChain) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
   const llvm::Triple::ArchType Arch = ToolChain.getArch();
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
 
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-  if (ToolChain.getTriple().isAndroid()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  if (ToolChain.getTriple().isMusl()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+    return getMuslDynamicLinker(Arch, ToolChain.getTriple().getEnvironment());
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
+  } else if (ToolChain.getTriple().isAndroid()) {
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     if (ToolChain.getTriple().isArch64Bit())
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
       return "/system/bin/linker64";
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
     else
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
-- 
Lucio Andrés Illanes Albornoz (arab, vxp) 585426
2.7.3
Lucio Andrés Illanes Albornoz (arab, vxp) 585426