From e8eaa2afd51ed9950096359a040ba1603907cdd1 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 8 Aug 2018 22:06:09 -0500 Subject: [PATCH] Use ELFv2 ABI on powerpc64 musl (LLVM half) --- src/rustllvm/PassWrapper.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 85fbc4bf378a5..15c3ab18d90e1 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -399,6 +399,12 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( Options.ThreadModel = ThreadModel::Single; } + // See https://reviews.llvm.org/D52013 + if (Trip.getArch() == llvm::Triple::ArchType::ppc64 && + Trip.getEnvironment() == llvm::Triple::EnvironmentType::Musl) { + Options.MCOptions.ABIName = "elfv2"; + } + #if LLVM_VERSION_GE(6, 0) Optional CM; #else