r361355 - [PPC64] Parse -elfv1 -elfv2 when specified on target triple
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Wed May 22 00:29:59 PDT 2019
Author: maskray
Date: Wed May 22 00:29:59 2019
New Revision: 361355
URL: http://llvm.org/viewvc/llvm-project?rev=361355&view=rev
Log:
[PPC64] Parse -elfv1 -elfv2 when specified on target triple
Summary:
For big-endian powerpc64, the default ABI is ELFv1. OpenPower ABI ELFv2 is supported when -mabi=elfv2 is specified. FreeBSD support for PowerPC64 ELFv2 ABI with LLVM is in progress[1]. This patch adds an alternative way to specify ELFv2 ABI on target triple [2].
The following results are expected:
ELFv1 when using:
-target powerpc64-unknown-freebsd12.0
-target powerpc64-unknown-freebsd12.0 -mabi=elfv1
-target powerpc64-unknown-freebsd12.0-elfv1
ELFv2 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv2
-target powerpc64-unknown-freebsd12.0-elfv2
[1] https://wiki.freebsd.org/powerpc/llvm-elfv2
[2] https://clang.llvm.org/docs/CrossCompilation.html
Patch by Alfredo Dal'Ava JĂșnior!
Differential Revision: https://reviews.llvm.org/D61950
Modified:
cfe/trunk/lib/Basic/Targets/PPC.h
Modified: cfe/trunk/lib/Basic/Targets/PPC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/PPC.h?rev=361355&r1=361354&r2=361355&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/PPC.h (original)
+++ cfe/trunk/lib/Basic/Targets/PPC.h Wed May 22 00:29:59 2019
@@ -379,13 +379,11 @@ public:
if ((Triple.getArch() == llvm::Triple::ppc64le)) {
resetDataLayout("e-m:e-i64:64-n32:64");
- ABI = "elfv2";
} else {
resetDataLayout("E-m:e-i64:64-n32:64");
- ABI = "elfv1";
}
- switch (getTriple().getOS()) {
+ switch (Triple.getOS()) {
case llvm::Triple::FreeBSD:
LongDoubleWidth = LongDoubleAlign = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
More information about the cfe-commits
mailing list