| 1 | Patch-Source: https://github.com/void-linux/void-packages/blob/master/srcpkgs/mozc/patches/abseil.patch
|
| 2 |
|
| 3 | Ported from grpc's patches
|
| 4 |
|
| 5 | An all-in-one patch that fixes several issues:
|
| 6 |
|
| 7 | 1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
|
| 8 | 2) powerpc stacktrace implementation only works on glibc (disabled on musl)
|
| 9 | 4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
|
| 10 |
|
| 11 | 2025-03-08: adapted from main/abseil-cpp to work with Firefox
|
| 12 |
|
| 13 | diff -Nurp a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h
|
| 14 | diff --git a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h
|
| 15 | index 43a3dab..cc0db72 100644
|
| 16 | |
| 17 | |
| 18 | @@ -21,7 +21,7 @@
|
| 19 |
|
| 20 | // The following platforms have an implementation of a hardware counter.
|
| 21 | #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
|
| 22 | - defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \
|
| 23 | + ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC)) || defined(_M_IX86) || \
|
| 24 | (defined(_M_X64) && !defined(_M_ARM64EC))
|
| 25 | #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
|
| 26 | #else
|
| 27 | diff --git a/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc b/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc
|
| 28 | index 3dd6ba1..bfe798d 100644
|
| 29 | |
| 30 | |
| 31 | @@ -36,6 +36,10 @@
|
| 32 | #include <csignal>
|
| 33 | #include <cstdio>
|
| 34 |
|
| 35 | +#if defined(__powerpc__)
|
| 36 | +#include <asm/ptrace.h>
|
| 37 | +#endif
|
| 38 | +
|
| 39 | #include "absl/base/attributes.h"
|
| 40 | #include "absl/base/internal/raw_logging.h"
|
| 41 | #include "absl/base/macros.h"
|
| 42 | @@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
|
| 43 | return reinterpret_cast<void*>(context->uc_mcontext.pc);
|
| 44 | #elif defined(__powerpc64__)
|
| 45 | return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
|
| 46 | +#elif defined(__powerpc__) && defined(__GLIBC__)
|
| 47 | + return reinterpret_cast<void*>(context->uc_mcontext.regs->nip);
|
| 48 | #elif defined(__powerpc__)
|
| 49 | - return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
|
| 50 | + return reinterpret_cast<void*>(((struct pt_regs *)context->uc_regs)->nip);
|
| 51 | #elif defined(__riscv)
|
| 52 | return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
|
| 53 | #elif defined(__s390__) && !defined(__s390x__)
|
| 54 | diff --git a/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h b/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
|
| 55 | index 88949fe..4e26a6b 100644
|
| 56 | |
| 57 | |
| 58 | @@ -67,7 +67,7 @@
|
| 59 | #elif defined(__i386__) || defined(__x86_64__)
|
| 60 | #define ABSL_STACKTRACE_INL_HEADER \
|
| 61 | "absl/debugging/internal/stacktrace_x86-inl.inc"
|
| 62 | -#elif defined(__ppc__) || defined(__PPC__)
|
| 63 | +#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
|
| 64 | #define ABSL_STACKTRACE_INL_HEADER \
|
| 65 | "absl/debugging/internal/stacktrace_powerpc-inl.inc"
|
| 66 | #elif defined(__aarch64__)
|