This is an archive of the discontinued LLVM Phabricator instance.

[sanitizers] [NFC] Add defines for the various PowerPC
ClosedPublic

Authored by koriakin on Apr 26 2016, 10:40 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

koriakin retitled this revision from to [sanitizers] [NFC] Add defines for the various PowerPC.
koriakin updated this object.
koriakin added reviewers: kcc, eugenis.
koriakin set the repository for this revision to rL LLVM.
koriakin added a project: Restricted Project.
koriakin added a subscriber: llvm-commits.
aizatsky accepted this revision.Apr 26 2016, 10:44 AM
aizatsky added a reviewer: aizatsky.
aizatsky added a subscriber: aizatsky.

As long as you are sure that BYTE_ORDER and _CALL_ELF means the same.

This revision is now accepted and ready to land.Apr 26 2016, 10:44 AM

As long as you are sure that BYTE_ORDER and _CALL_ELF means the same.

It doesn't really, but _CALL_ELF is the correct one.

The story is: there are two ABIs for ppc64 (determined by _CALL_ELF) and two endians. Originally, only BE was used. One day, they decided to transition to LE for whatever reason, and made a new ABI while they were at it. So if you configure for powerpc64, you get BE and v1, while configuring for powerpc64le results in v2. It is possible to convince gcc (but not llvm) to compile for other combinations via some -m options, but you won't find such cases in the wild (someone would have to compile a full system like that, and it's quite painful).

eugenis edited edge metadata.Apr 26 2016, 11:08 AM

Thanks for the explanation. Maybe add a short comment with this info near the macro definitions. Is it true that in V2 ABI function pointers are simple code pointers?

Thanks for the explanation. Maybe add a short comment with this info near the macro definitions. Is it true that in V2 ABI function pointers are simple code pointers?

I'll add a comment. Yeah, in v2 (or 32-bit ppc, for that matter) function pointers are plain old code pointers, like on most architectures.

This revision was automatically updated to reflect the committed changes.