--- llvm-6.0.1.src/lib/Target/PowerPC/PPCTargetMachine.cpp.orig	2018-09-13 03:51:11.900000000 +0000
+++ llvm-6.0.1.src/lib/Target/PowerPC/PPCTargetMachine.cpp	2018-09-13 03:56:10.740000000 +0000
@@ -191,6 +191,10 @@
   if (TT.isMacOSX())
     return PPCTargetMachine::PPC_ABI_UNKNOWN;
 
+  // musl uses ELFv2 ABI on both endians.
+  if (TT.getEnvironment() == Triple::Musl)
+    return PPCTargetMachine::PPC_ABI_ELFv2;
+
   switch (TT.getArch()) {
   case Triple::ppc64le:
     return PPCTargetMachine::PPC_ABI_ELFv2;