--- thrift/lib/cpp2/server/Cpp2ConnContext.cpp.orig	2022-08-08 09:08:18.000000000 +0700
+++ thrift/lib/cpp2/server/Cpp2ConnContext.cpp	2022-08-15 12:40:56.000000000 +0700
@@ -22,6 +22,14 @@
 #include <sys/ucred.h> // @manual
 #endif
 
+#if !defined(SOL_LOCAL) && defined(__APPLE__)
+#define SOL_LOCAL 0
+#endif
+
+#if !defined(LOCAL_PEEREPID) && defined(__APPLE__)
+#define LOCAL_PEEREPID 0x003 // retrieve eff. peer pid
+#endif
+
 namespace {
 
 #ifndef _WIN32


# ParallelConcurrencyController.h:65:40: error: static assertion failed
# static_assert(std::atomic<Counters>::is_always_lock_free);
--- thrift/lib/cpp2/server/ParallelConcurrencyController.h.orig	2022-08-08 09:08:18.000000000 +0700
+++ thrift/lib/cpp2/server/ParallelConcurrencyController.h	2022-08-15 21:39:26.000000000 +0700
@@ -55,12 +55,21 @@
  private:
   struct Counters {
     constexpr Counters() noexcept = default;
+#if defined(__ppc__)
+    // Number of requests that are being executed
+    // by the executor
+    uint16_t requestInExecution{0};
+    // Number of requests that sit in the queue waiting
+    // to be dequeued by the ConcurrencyController
+    uint16_t pendingDequeCalls{0};
+#else // Everything else besides ppc32
     // Number of requests that are being executed
     // by the executor
     uint32_t requestInExecution{0};
     // Number of requests that sit in the queue waiting
     // to be dequeued by the ConcurrencyController
     uint32_t pendingDequeCalls{0};
+#endif
   };
   static_assert(std::atomic<Counters>::is_always_lock_free);
 

# https://trac.macports.org/attachment/ticket/50288/leopard-IPV6_TCLASS.patch
--- thrift/lib/cpp2/transport/rocket/server/RocketServerConnection.cpp.orig	2022-08-08 10:08:18.000000000 +0800
+++ thrift/lib/cpp2/transport/rocket/server/RocketServerConnection.cpp	2022-10-15 16:36:39.000000000 +0800
@@ -49,6 +49,14 @@
 #include <thrift/lib/cpp2/transport/rocket/server/RocketSinkClientCallback.h>
 #include <thrift/lib/cpp2/transport/rocket/server/RocketStreamClientCallback.h>
 
+#ifndef IPV6_TCLASS
+#if defined(__GNU__)
+#define IPV6_TCLASS 61
+#elif defined(__APPLE__)
+#define IPV6_TCLASS 36
+#endif
+#endif
+
 THRIFT_FLAG_DEFINE_bool(enable_rocket_connection_observers, false);
 
 namespace apache {
