[PATCH] D116017: [ELF] #undef PPC to support GCC powerpc32 build

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 19 22:40:58 PST 2021


MaskRay created this revision.
MaskRay added reviewers: thesamesam, jhibbits.
Herald added subscribers: steven.zhang, shchenz, kbarton, krytarowski, arichardson, nemanjai, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116017

Files:
  lld/ELF/Arch/PPC.cpp


Index: lld/ELF/Arch/PPC.cpp
===================================================================
--- lld/ELF/Arch/PPC.cpp
+++ lld/ELF/Arch/PPC.cpp
@@ -20,6 +20,9 @@
 using namespace lld;
 using namespace lld::elf;
 
+// Undefine the macro predefined by GCC powerpc32.
+#undef PPC
+
 namespace {
 class PPC final : public TargetInfo {
 public:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116017.395378.patch
Type: text/x-patch
Size: 342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211220/252fa8a3/attachment.bin>


More information about the llvm-commits mailing list