[PATCH] D80421: [Mips] use correct ld.so for musl soft float

Joe Holden via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 21 16:01:48 PST 2021


joewholden updated this revision to Diff 318343.
joewholden added a comment.

I think this is better (we've been using it for a while successfully), I haven't had time to understand the tests enough to add some yet, but I'll take a look as soon as I can


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80421/new/

https://reviews.llvm.org/D80421

Files:
  clang/lib/Driver/ToolChains/Linux.cpp


Index: clang/lib/Driver/ToolChains/Linux.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Linux.cpp
+++ clang/lib/Driver/ToolChains/Linux.cpp
@@ -519,6 +519,7 @@
   if (Triple.isMusl()) {
     std::string ArchName;
     bool IsArm = false;
+    bool IsMips = false;
 
     switch (Arch) {
     case llvm::Triple::arm:
@@ -531,14 +532,25 @@
       ArchName = "armeb";
       IsArm = true;
       break;
+    case llvm::Triple::mips:
+    case llvm::Triple::mipsel:
+    case llvm::Triple::mips64:
+    case llvm::Triple::mips64el:
+      IsMips = true;
+      ArchName = Triple.getArchName().str();
+      break;
     default:
       ArchName = Triple.getArchName().str();
     }
+
     if (IsArm &&
         (Triple.getEnvironment() == llvm::Triple::MuslEABIHF ||
          tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard))
       ArchName += "hf";
 
+    if (IsMips && tools::mips::getMipsFloatABI(getDriver(), Args, getTriple()) == tools::mips::FloatABI::Soft)
+      ArchName += "-sf";
+
     return "/lib/ld-musl-" + ArchName + ".so.1";
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80421.318343.patch
Type: text/x-patch
Size: 1125 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210122/1aa80ba8/attachment.bin>


More information about the cfe-commits mailing list