| 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 | --- a/absl/debugging/internal/examine_stack.cc |
| 12 | +++ b/absl/debugging/internal/examine_stack.cc |
| 13 | @@ -33,6 +33,10 @@ |
| 14 | #include <csignal> |
| 15 | #include <cstdio> |
| 16 | |
| 17 | +#if defined(__powerpc__) |
| 18 | +#include <asm/ptrace.h> |
| 19 | +#endif |
| 20 | + |
| 21 | #include "absl/base/attributes.h" |
| 22 | #include "absl/base/internal/raw_logging.h" |
| 23 | #include "absl/base/macros.h" |
| 24 | @@ -174,8 +178,10 @@ |
| 25 | return reinterpret_cast<void*>(context->uc_mcontext.pc); |
| 26 | #elif defined(__powerpc64__) |
| 27 | return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]); |
| 28 | +#elif defined(__powerpc__) && defined(__GLIBC__) |
| 29 | + return reinterpret_cast<void*>(context->uc_mcontext.regs->nip); |
| 30 | #elif defined(__powerpc__) |
| 31 | - return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]); |
| 32 | + return reinterpret_cast<void*>(((struct pt_regs *)context->uc_regs)->nip); |
| 33 | #elif defined(__riscv) |
| 34 | return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]); |
| 35 | #elif defined(__s390__) && !defined(__s390x__) |
| 36 | --- a/absl/debugging/internal/stacktrace_config.h |
| 37 | +++ b/absl/debugging/internal/stacktrace_config.h |
| 38 | @@ -60,7 +60,7 @@ |
| 39 | #elif defined(__i386__) || defined(__x86_64__) |
| 40 | #define ABSL_STACKTRACE_INL_HEADER \ |
| 41 | "absl/debugging/internal/stacktrace_x86-inl.inc" |
| 42 | -#elif defined(__ppc__) || defined(__PPC__) |
| 43 | +#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__) |
| 44 | #define ABSL_STACKTRACE_INL_HEADER \ |
| 45 | "absl/debugging/internal/stacktrace_powerpc-inl.inc" |
| 46 | #elif defined(__aarch64__) |
| 47 | --- a/absl/base/internal/unscaledcycleclock_config.h |
| 48 | +++ b/absl/base/internal/unscaledcycleclock_config.h |
| 49 | @@ -21,7 +21,8 @@ |
| 50 | |
| 51 | // The following platforms have an implementation of a hardware counter. |
| 52 | #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ |
| 53 | - defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ |
| 54 | + defined(__riscv) || \ |
| 55 | + ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ |
| 56 | defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) |
| 57 | #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 |
| 58 | #else |