Skip to content

Commit e8eaa2a

Browse files
committed
Use ELFv2 ABI on powerpc64 musl (LLVM half)
1 parent 106a31d commit e8eaa2a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rustllvm/PassWrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
399399
Options.ThreadModel = ThreadModel::Single;
400400
}
401401

402+
// See https://reviews.llvm.org/D52013
403+
if (Trip.getArch() == llvm::Triple::ArchType::ppc64 &&
404+
Trip.getEnvironment() == llvm::Triple::EnvironmentType::Musl) {
405+
Options.MCOptions.ABIName = "elfv2";
406+
}
407+
402408
#if LLVM_VERSION_GE(6, 0)
403409
Optional<CodeModel::Model> CM;
404410
#else

0 commit comments

Comments
 (0)