This is an archive of the discontinued LLVM Phabricator instance.

[ELF] #undef PPC to support GCC powerpc32 build
ClosedPublic

Authored by MaskRay on Dec 19 2021, 10:40 PM.

Details

Summary

GCC's powerpc32 port predefines PPC as a macro in GNU C++ mode in some configurations (Linux,
FreeBSD, and some others. See builtin_define_std ("PPC"); in gcc/config/rs6000).

% powerpc-linux-gnu-g++ -E -dM -xc++ /dev/null -o - | grep -w PPC
#define PPC 1

Fixes https://bugs.gentoo.org/829599

Diff Detail

Event Timeline

MaskRay created this revision.Dec 19 2021, 10:40 PM
MaskRay requested review of this revision.Dec 19 2021, 10:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 19 2021, 10:40 PM
MaskRay edited the summary of this revision. (Show Details)Dec 19 2021, 10:41 PM
thesamesam accepted this revision.EditedDec 20 2021, 1:35 AM

Thanks. I don't see where PPC is reserved and I'm not even sure why GCC is setting it, but it is what it is, so this is the easiest way forward.

This revision is now accepted and ready to land.Dec 20 2021, 1:35 AM
MaskRay edited the summary of this revision. (Show Details)Dec 20 2021, 1:38 AM
MaskRay edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.