[PATCH] D144232: [PowerPC] Correctly use ELFv2 ABI on FreeBSD/powerpc64
Piotr Kubaj via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 16 16:02:44 PST 2023
pkubaj updated this revision to Diff 498185.
pkubaj added a comment.
Fix indenting according to clang-format suggestions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144232/new/
https://reviews.llvm.org/D144232
Files:
clang/lib/Basic/Targets/PPC.h
llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -233,6 +233,11 @@
assert(Options.MCOptions.getABIName().empty() &&
"Unknown target-abi option!");
+ if (TT.isOSFreeBSD() && TT.getArch() == Triple::ppc64 &&
+ (TT.getOSMajorVersion() == 0 || TT.getOSMajorVersion() >= 13)) {
+ return PPCTargetMachine::PPC_ABI_ELFv2;
+ }
+
switch (TT.getArch()) {
case Triple::ppc64le:
return PPCTargetMachine::PPC_ABI_ELFv2;
Index: clang/lib/Basic/Targets/PPC.h
===================================================================
--- clang/lib/Basic/Targets/PPC.h
+++ clang/lib/Basic/Targets/PPC.h
@@ -425,6 +425,10 @@
} 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";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144232.498185.patch
Type: text/x-patch
Size: 1235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230217/72d6b9e7/attachment.bin>
More information about the cfe-commits
mailing list