ports/devel/llvm15/files/patch-lib_Target_PowerPC_PPCTargetMachine.cpp
Brooks Davis f3d912a7b9 devel/llvm15: boostrap from devel/llvm14
Make an as-is copy of llvm14 as devel/llvm15. It will be updated to
LLVM 15 and connected to the build in the next commit.  This makes it
easier to see what has changed.
2022-08-11 00:01:09 +01:00

23 lines
730 B
C++

--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp.orig 2019-07-04 07:43:51 UTC
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -209,6 +209,20 @@ static PPCTargetMachine::PPCABI computeTargetABI(const
if (TT.isMacOSX())
return PPCTargetMachine::PPC_ABI_UNKNOWN;
+ if (TT.isOSFreeBSD()) {
+ switch (TT.getArch()) {
+ case Triple::ppc64le:
+ case Triple::ppc64:
+ if (TT.getOSMajorVersion() >= 13)
+ return PPCTargetMachine::PPC_ABI_ELFv2;
+ else
+ return PPCTargetMachine::PPC_ABI_ELFv1;
+ case Triple::ppc:
+ default:
+ return PPCTargetMachine::PPC_ABI_UNKNOWN;
+ }
+ }
+
switch (TT.getArch()) {
case Triple::ppc64le:
return PPCTargetMachine::PPC_ABI_ELFv2;