diff options
| author | Will Schmidt <will_schmidt@vnet.ibm.com> | 2014-03-24 17:27:03 +0000 |
|---|---|---|
| committer | Will Schmidt <will_schmidt@vnet.ibm.com> | 2014-03-24 17:27:03 +0000 |
| commit | 22d2435a00c9c288bf9bdd2d7f3e15557c3f4e06 (patch) | |
| tree | 63032f8c706e0c4beb9d3f0327955b237ae870cb /clang/lib/Basic | |
| parent | c1fc190913401b24379842fe76250f5476ad40b4 (diff) | |
| download | bcm5719-llvm-22d2435a00c9c288bf9bdd2d7f3e15557c3f4e06.tar.gz bcm5719-llvm-22d2435a00c9c288bf9bdd2d7f3e15557c3f4e06.zip | |
[PPC64LE] Add a CALL_ELF macro to indicate use of the ELFv2 ABI.
Additional clarification from Uli for the background on _CALL_ELF:
"Historically GCC has provided various _CALL_... predefines depending on the
ABI currently being compiled for. (_CALL_SYSV,_CALL_AIXDESC, _CALL_DARWIN )
When we needed a new define for the current ABI, we decided on using _CALL_ELF
since the official name of the ABI is the OpenPower ElfV2 ABI, with the
current Linux ABI retro-actively being renamed the ELFv1 ABI
and so we decided on using _CALL_ELF to identify the Linux (+BSD etc.) ELF ABI,
with _CALL_ELF=1 for the v1 ABI and _CALL_ELF=2 for the v2 ABI.
(Note that this matches the gcc compiler switch -mabi=elfv1 vs. -mabi=elfv2)."
In code, a (_CALL_ELF==2) check will indicate when the ELFv2 ABI is
to be used. This is the desired default for the PPC64 LE target.
llvm-svn: 204627
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 0e1292d48d5..d22599dec61 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -939,6 +939,7 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, // Target properties. if (getTriple().getArch() == llvm::Triple::ppc64le) { Builder.defineMacro("_LITTLE_ENDIAN"); + Builder.defineMacro("_CALL_ELF","2"); } else { if (getTriple().getOS() != llvm::Triple::NetBSD && getTriple().getOS() != llvm::Triple::OpenBSD) |

