mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
llvm: make sure to use ELFv2 ABI on powerpc64
Currently LLVM is more or less set up to use ELFv2, but it still defaults to ELFv1 in some places. This causes lld to generate broken binaries when used with LTO. PR: 269455 Approved by: dim MFC after: 3 days
This commit is contained in:
parent
780bae23b8
commit
a1ffc2fe9c
@ -427,6 +427,9 @@ class LLVM_LIBRARY_VISIBILITY PPC64TargetInfo : public PPCTargetInfo {
|
||||
} else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
|
||||
DataLayout = "e-m:e-i64:64-n32:64";
|
||||
ABI = "elfv2";
|
||||
} else if (Triple.isOSFreeBSD() && (Triple.getOSMajorVersion() == 0 || Triple.getOSMajorVersion() >= 13)) {
|
||||
DataLayout = "E-m:e-i64:64-n32:64";
|
||||
ABI = "elfv2";
|
||||
} else {
|
||||
DataLayout = "E-m:e-i64:64-n32:64";
|
||||
ABI = "elfv1";
|
||||
|
@ -231,8 +231,11 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
|
||||
assert(Options.MCOptions.getABIName().empty() &&
|
||||
"Unknown target-abi option!");
|
||||
|
||||
if (TT.isMacOSX())
|
||||
if (TT.isMacOSX()) {
|
||||
return PPCTargetMachine::PPC_ABI_UNKNOWN;
|
||||
} else if (TT.isOSFreeBSD() && TT.getArch() == Triple::ppc64 && (TT.getOSMajorVersion() == 0 || TT.getOSMajorVersion() >= 13)) {
|
||||
return PPCTargetMachine::PPC_ABI_ELFv2;
|
||||
}
|
||||
|
||||
switch (TT.getArch()) {
|
||||
case Triple::ppc64le:
|
||||
|
Loading…
Reference in New Issue
Block a user