mirror of
https://git.freebsd.org/ports.git
synced 2025-06-22 13:10:31 -04:00
powerpc64: add configure option to select ELFv2 ABI In preparation for compiler+ABI change in PowerPC64, this change adds a configure option to select ELFv2 as default powerpc64 ABI when compiling llvm-devel. The new option automatically set when ELFv2 environment is detected (when PPC_ABI=ELFv2) Submitted by: Alfredo Dal'Ava Júnior Differential Revision: https://reviews.freebsd.org/D22100
23 lines
720 B
C++
23 lines
720 B
C++
--- lib/Target/PowerPC/PPCTargetMachine.cpp.orig 2019-07-04 07:43:51 UTC
|
|
+++ 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;
|