Fall back to the generic UNIX signal and exception handlers on PowerPC.

Also fix PPC platform detection.

--- js/src/ds/MemoryProtectionExceptionHandler.cpp.orig
+++ js/src/ds/MemoryProtectionExceptionHandler.cpp
@@ -11,7 +11,7 @@
 
 #if defined(XP_WIN)
 #include "util/Windows.h"
-#elif defined(XP_UNIX) && !defined(XP_DARWIN)
+#elif defined(XP_UNIX) && (defined(__POWERPC__) || !defined(XP_DARWIN))
 #include <signal.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -204,7 +204,7 @@
   }
 }
 
-#elif defined(XP_UNIX) && !defined(XP_DARWIN)
+#elif defined(XP_UNIX) && (defined(__POWERPC__) || !defined(XP_DARWIN))
 
 static struct sigaction sPrevSEGVHandler = {};
 
--- js/src/vm/JSContext.h.orig
+++ js/src/vm/JSContext.h
@@ -586,7 +586,7 @@
   void disableProfilerSampling() { suppressProfilerSampling = true; }
   void enableProfilerSampling() { suppressProfilerSampling = false; }
 
-#if defined(XP_DARWIN)
+#if defined(XP_DARWIN) && !defined(__POWERPC__)
   js::wasm::MachExceptionHandler wasmMachExceptionHandler;
 #endif
 
--- js/src/wasm/WasmSignalHandlers.cpp.orig
+++ js/src/wasm/WasmSignalHandlers.cpp
@@ -400,7 +400,7 @@
 // the same as CONTEXT, but on Mac we use a different structure since we call
 // into the emulator code from a Mach exception handler rather than a
 // sigaction-style signal handler.
-#if defined(XP_DARWIN)
+#if defined(XP_DARWIN) && !defined(__POWERPC__)
 #if defined(__x86_64__)
 struct macos_x64_context {
   x86_thread_state64_t thread;
@@ -488,7 +488,7 @@
 #endif
 #endif  // KNOWS_MACHINE_STATE
 
-#if defined(XP_DARWIN)
+#if defined(XP_DARWIN) && !defined(__POWERPC__)
 
 static uint8_t** ContextToPC(EMULATOR_CONTEXT* context) {
 #if defined(__x86_64__)
@@ -1160,7 +1160,7 @@
   return EXCEPTION_CONTINUE_SEARCH;
 }
 
-#elif defined(XP_DARWIN)
+#elif defined(XP_DARWIN) && !defined(__POWERPC__)
 #include <mach/exc.h>
 
 // This definition was generated by mig (the Mach Interface Generator) for the
@@ -1717,7 +1717,7 @@
 #endif
   if (!AddVectoredExceptionHandler(firstHandler, WasmFaultHandler))
     return false;
-#elif defined(XP_DARWIN)
+#elif defined(XP_DARWIN) && !defined(__POWERPC__)
   // OSX handles seg faults via the Mach exception handler above, so don't
   // install WasmFaultHandler.
 #else
@@ -1761,7 +1761,7 @@
   // Nothing to do if the platform doesn't support it.
   if (!ProcessHasSignalHandlers()) return true;
 
-#if defined(XP_DARWIN)
+#if defined(XP_DARWIN) && !defined(__POWERPC__)
   // On OSX, each JSContext which runs wasm gets its own handler thread.
   if (!cx->wasmMachExceptionHandler.installed() &&
       !cx->wasmMachExceptionHandler.install(cx))
--- python/mozbuild/mozbuild/configure/constants.py.orig
+++ python/mozbuild/mozbuild/configure/constants.py
@@ -80,8 +80,8 @@
     ('ia64', '__ia64__'),
     ('s390x', '__s390x__'),
     ('s390', '__s390__'),
-    ('ppc64', '__powerpc64__'),
-    ('ppc', '__powerpc__'),
+    ('ppc64', '__powerpc64__ || __ppc64__'),
+    ('ppc', '__powerpc__ || __ppc__'),
     ('Alpha', '__alpha__'),
     ('hppa', '__hppa__'),
     ('sparc64', '__sparc__ && __arch64__'),
