Skip to content

Commit bee5bc9

Browse files
committed
[ELF] #undef PPC to support GCC powerpc32 build
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 Reviewed By: thesamesam Differential Revision: https://reviews.llvm.org/D116017
1 parent 4c5476b commit bee5bc9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lld/ELF/Arch/PPC.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ using namespace llvm::ELF;
2020
using namespace lld;
2121
using namespace lld::elf;
2222

23+
// Undefine the macro predefined by GCC powerpc32.
24+
#undef PPC
25+
2326
namespace {
2427
class PPC final : public TargetInfo {
2528
public:

0 commit comments

Comments
 (0)