summaryrefslogblamecommitdiff
path: root/user/clang/ppc64-elfv2.patch
blob: 236bd9ae88365b4199be80eb74d59c4f196ab6be (plain) (tree)




























                                                                                           
                     







                                                                           
--- cfe-8.0.0.src/lib/Basic/Targets/PPC.h.old	2019-02-12 11:19:21.000000000 +0000
+++ cfe-8.0.0.src/lib/Basic/Targets/PPC.h	2019-06-01 23:18:07.613180102 +0000
@@ -367,7 +367,7 @@
       ABI = "elfv2";
     } else {
       resetDataLayout("E-m:e-i64:64-n32:64");
-      ABI = "elfv1";
+      ABI = (Triple.getEnvironment() == llvm::Triple::Musl) ? "elfv2" : "elfv1";
     }
 
     switch (getTriple().getOS()) {
@@ -375,6 +375,15 @@
       LongDoubleWidth = LongDoubleAlign = 64;
       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
       break;
+    default:
+      break;
+    }
+
+    switch (getTriple().getEnvironment()) {
+    case llvm::Triple::Musl:
+      LongDoubleWidth = LongDoubleAlign = 64;
+      LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+      break;
     default:
       break;
     }
--- cfe-8.0.0.src/lib/Driver/ToolChains/Clang.cpp.old	2019-01-25 00:15:41.000000000 +0000
+++ cfe-8.0.0.src/lib/Driver/ToolChains/Clang.cpp	2019-06-01 23:19:33.973868618 +0000
@@ -1751,7 +1751,7 @@
         break;
       }
 
-      ABIName = "elfv1";
+      ABIName = (getToolChain().getTriple().isMusl()) ? "elfv2" : "elfv1";
       break;
     }
     case llvm::Triple::ppc64le: