From 0373b8ad493741c335f535e92b2f5a1a4f17be22 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Fri, 4 Apr 2025 06:45:40 +0800
Subject: [PATCH] build_config.h: fix macros

---
 v8/src/base/build_config.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/v8/src/base/build_config.h b/v8/src/base/build_config.h
index 8d142c45..cec09c4e 100644
--- a/v8/src/base/build_config.h
+++ b/v8/src/base/build_config.h
@@ -33,10 +33,10 @@
 #elif defined(__MIPSEB__) || defined(__MIPSEL__)
 #define V8_HOST_ARCH_MIPS 1
 #define V8_HOST_ARCH_32_BIT 1
-#elif defined(__PPC64__) || defined(_ARCH_PPC64)
+#elif defined(__PPC64__) || defined(_ARCH_PPC64) || defined(__ppc64__)
 #define V8_HOST_ARCH_PPC64 1
 #define V8_HOST_ARCH_64_BIT 1
-#elif defined(__PPC__) || defined(_ARCH_PPC)
+#elif defined(__PPC__) || defined(_ARCH_PPC) || defined(__ppc__)
 #define V8_HOST_ARCH_PPC 1
 #define V8_HOST_ARCH_32_BIT 1
 #elif defined(__s390__) || defined(__s390x__)
@@ -90,9 +90,9 @@
 #define V8_TARGET_ARCH_MIPS64 1
 #elif defined(__MIPSEB__) || defined(__MIPSEL__)
 #define V8_TARGET_ARCH_MIPS 1
-#elif defined(_ARCH_PPC64)
+#elif defined(_ARCH_PPC64) || defined(__ppc64__)
 #define V8_TARGET_ARCH_PPC64 1
-#elif defined(_ARCH_PPC)
+#elif defined(_ARCH_PPC) || defined(__ppc__)
 #define V8_TARGET_ARCH_PPC 1
 #else
 #error Target architecture was not detected as supported by v8
@@ -178,6 +178,8 @@
 #else
 #define V8_TARGET_LITTLE_ENDIAN 1
 #endif
+#elif defined(__POWERPC__)
+#define V8_TARGET_BIG_ENDIAN 1
 #elif __BIG_ENDIAN__  // FOR PPCGR on AIX
 #define V8_TARGET_BIG_ENDIAN 1
 #elif V8_TARGET_ARCH_PPC_LE
@@ -201,7 +203,7 @@
 #endif
 
 // Number of bits to represent the page size for paged spaces.
-#if defined(V8_TARGET_ARCH_PPC) || defined(V8_TARGET_ARCH_PPC64)
+#if V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64
 // PPC has large (64KB) physical pages.
 const int kPageSizeBits = 19;
 #else
