llvm8: restore ppc patches with standard prefix

closes #10752
This commit is contained in:
maxice8 2019-04-09 20:49:16 -03:00
parent 232e8edc63
commit 63d58a680d
No known key found for this signature in database
GPG Key ID: 543B9D4F4299F06B
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,18 @@
--- a/lib/Driver/ToolChains/Linux.cpp 2018-12-16 23:52:16.174867512 +0100
+++ b/lib/Driver/ToolChains/Linux.cpp 2018-12-16 23:56:25.040531791 +0100
@@ -502,12 +502,12 @@
Loader = "ld.so.1";
break;
case llvm::Triple::ppc64:
- LibDir = "lib64";
+ LibDir = "lib";
Loader =
(tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
break;
case llvm::Triple::ppc64le:
- LibDir = "lib64";
+ LibDir = "lib";
Loader =
(tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
break;

View File

@ -0,0 +1,30 @@
--- a/lib/Basic/Targets/PPC.h
+++ b/lib/Basic/Targets/PPC.h
@@ -358,7 +358,10 @@ public:
ABI = "elfv2";
} else {
resetDataLayout("E-m:e-i64:64-n32:64");
- ABI = "elfv1";
+ if (Triple.getEnvironment() == llvm::Triple::Musl)
+ ABI = "elfv2";
+ else
+ ABI = "elfv1";
}
switch (getTriple().getOS()) {
diff --git a/tools/clang/lib/Driver/ToolChains/Clang.cpp b/tools/clang/lib/Driver/ToolChains/Clang.cpp
index 8e9c4c6a..40817ec3 100644
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -1618,7 +1618,10 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
break;
}
- ABIName = "elfv1";
+ if (getToolChain().getTriple().getEnvironment() == llvm::Triple::Musl)
+ ABIName = "elfv2";
+ else
+ ABIName = "elfv1";
break;
}
case llvm::Triple::ppc64le: