[PATCH] D118320: llvm-libunwind build fix for GCC on PPC32

Sam James via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 23:46:05 PST 2022


thesamesam updated this revision to Diff 403515.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118320/new/

https://reviews.llvm.org/D118320

Files:
  libunwind/include/__libunwind_config.h
  libunwind/src/UnwindRegistersRestore.S
  libunwind/src/UnwindRegistersSave.S
  libunwind/src/assembly.h
  libunwind/src/config.h
  libunwind/src/libunwind.cpp


Index: libunwind/src/libunwind.cpp
===================================================================
--- libunwind/src/libunwind.cpp
+++ libunwind/src/libunwind.cpp
@@ -51,7 +51,7 @@
 # define REGISTER_KIND Registers_x86_64
 #elif defined(__powerpc64__)
 # define REGISTER_KIND Registers_ppc64
-#elif defined(__ppc__)
+#elif defined(__ppc__) || defined(__PPC__)
 # define REGISTER_KIND Registers_ppc
 #elif defined(__aarch64__)
 # define REGISTER_KIND Registers_arm64
Index: libunwind/src/config.h
===================================================================
--- libunwind/src/config.h
+++ libunwind/src/config.h
@@ -105,7 +105,7 @@
 #define _LIBUNWIND_BUILD_SJLJ_APIS
 #endif

-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__PPC__) || defined(__ppc64__) || defined(__powerpc64__)
 #define _LIBUNWIND_SUPPORT_FRAME_APIS
 #endif

Index: libunwind/src/assembly.h
===================================================================
--- libunwind/src/assembly.h
+++ libunwind/src/assembly.h
@@ -216,7 +216,7 @@
 #endif
 #endif /* __arm__ */

-#if defined(__ppc__) || defined(__powerpc64__)
+#if defined(__ppc__) || defined(__PPC__) || defined(__powerpc64__)
 #define PPC_LEFT_SHIFT(index) << (index)
 #endif

Index: libunwind/src/UnwindRegistersSave.S
===================================================================
--- libunwind/src/UnwindRegistersSave.S
+++ libunwind/src/UnwindRegistersSave.S
@@ -556,7 +556,7 @@
   blr


-#elif defined(__ppc__)
+#elif defined(__ppc__) || defined(__PPC__)

 //
 // extern int unw_getcontext(unw_context_t* thread_state)
Index: libunwind/src/UnwindRegistersRestore.S
===================================================================
--- libunwind/src/UnwindRegistersRestore.S
+++ libunwind/src/UnwindRegistersRestore.S
@@ -389,7 +389,7 @@
   PPC64_LR(3)
   bctr

-#elif defined(__ppc__)
+#elif defined(__ppc__) || defined(__PPC__)

 DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
 //
Index: libunwind/include/__libunwind_config.h
===================================================================
--- libunwind/include/__libunwind_config.h
+++ libunwind/include/__libunwind_config.h
@@ -55,7 +55,7 @@
 #  define _LIBUNWIND_CONTEXT_SIZE 167
 #  define _LIBUNWIND_CURSOR_SIZE 179
 #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
-# elif defined(__ppc__)
+# elif defined(__ppc__) || defined(__PPC__)
 #  define _LIBUNWIND_TARGET_PPC 1
 #  define _LIBUNWIND_CONTEXT_SIZE 117
 #  define _LIBUNWIND_CURSOR_SIZE 124


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118320.403515.patch
Type: text/x-patch
Size: 2656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/206d2da2/attachment.bin>


More information about the llvm-commits mailing list