diff options
Diffstat (limited to 'meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch')
-rw-r--r-- | meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file mode 100644 index 000000000..ba0cd6692 --- /dev/null +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch | |||
@@ -0,0 +1,103 @@ | |||
1 | From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 21 Sep 2024 20:53:06 +0800 | ||
4 | Subject: [PATCH] abseil: ppc fixes | ||
5 | |||
6 | An all-in-one patch that fixes several issues: | ||
7 | |||
8 | 1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl) | ||
9 | 2) powerpc stacktrace implementation only works on glibc (disabled on musl) | ||
10 | 3) powerpc stacktrace implementation has ppc64 assumptions (fixed) | ||
11 | 4) examine_stack.cpp makes glibc assumptions on powerpc (fixed) | ||
12 | |||
13 | Sourced from void linux | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | |||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | absl/base/internal/unscaledcycleclock.cc | 4 ++-- | ||
20 | absl/base/internal/unscaledcycleclock_config.h | 3 ++- | ||
21 | absl/debugging/internal/examine_stack.cc | 8 +++++++- | ||
22 | absl/debugging/internal/stacktrace_config.h | 2 +- | ||
23 | 4 files changed, 12 insertions(+), 5 deletions(-) | ||
24 | |||
25 | diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc | ||
26 | index a0bf3a65..103b4f6a 100644 | ||
27 | --- a/absl/base/internal/unscaledcycleclock.cc | ||
28 | +++ b/absl/base/internal/unscaledcycleclock.cc | ||
29 | @@ -20,7 +20,7 @@ | ||
30 | #include <intrin.h> | ||
31 | #endif | ||
32 | |||
33 | -#if defined(__powerpc__) || defined(__ppc__) | ||
34 | +#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__) | ||
35 | #ifdef __GLIBC__ | ||
36 | #include <sys/platform/ppc.h> | ||
37 | #elif defined(__FreeBSD__) | ||
38 | @@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() { | ||
39 | return base_internal::NominalCPUFrequency(); | ||
40 | } | ||
41 | |||
42 | -#elif defined(__powerpc__) || defined(__ppc__) | ||
43 | +#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__) | ||
44 | |||
45 | int64_t UnscaledCycleClock::Now() { | ||
46 | #ifdef __GLIBC__ | ||
47 | diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h | ||
48 | index 43a3dabe..196a8535 100644 | ||
49 | --- a/absl/base/internal/unscaledcycleclock_config.h | ||
50 | +++ b/absl/base/internal/unscaledcycleclock_config.h | ||
51 | @@ -21,7 +21,8 @@ | ||
52 | |||
53 | // The following platforms have an implementation of a hardware counter. | ||
54 | #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ | ||
55 | - defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \ | ||
56 | + ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ | ||
57 | + defined(_M_IX86) || \ | ||
58 | (defined(_M_X64) && !defined(_M_ARM64EC)) | ||
59 | #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 | ||
60 | #else | ||
61 | diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc | ||
62 | index 3dd6ba1a..f923b055 100644 | ||
63 | --- a/absl/debugging/internal/examine_stack.cc | ||
64 | +++ b/absl/debugging/internal/examine_stack.cc | ||
65 | @@ -36,6 +36,10 @@ | ||
66 | #include <csignal> | ||
67 | #include <cstdio> | ||
68 | |||
69 | +#if defined(__powerpc__) | ||
70 | +#include <asm/ptrace.h> | ||
71 | +#endif | ||
72 | + | ||
73 | #include "absl/base/attributes.h" | ||
74 | #include "absl/base/internal/raw_logging.h" | ||
75 | #include "absl/base/macros.h" | ||
76 | @@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) { | ||
77 | return reinterpret_cast<void*>(context->uc_mcontext.pc); | ||
78 | #elif defined(__powerpc64__) | ||
79 | return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]); | ||
80 | -#elif defined(__powerpc__) | ||
81 | +#elif defined(__powerpc__) && defined(__GLIBC__) | ||
82 | return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]); | ||
83 | +#elif defined(__powerpc__) | ||
84 | + return reinterpret_cast<void*>((context->uc_regs)->gregs[32]); | ||
85 | #elif defined(__riscv) | ||
86 | return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]); | ||
87 | #elif defined(__s390__) && !defined(__s390x__) | ||
88 | diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h | ||
89 | index 3929b1b7..23d5e504 100644 | ||
90 | --- a/absl/debugging/internal/stacktrace_config.h | ||
91 | +++ b/absl/debugging/internal/stacktrace_config.h | ||
92 | @@ -60,7 +60,7 @@ | ||
93 | #elif defined(__i386__) || defined(__x86_64__) | ||
94 | #define ABSL_STACKTRACE_INL_HEADER \ | ||
95 | "absl/debugging/internal/stacktrace_x86-inl.inc" | ||
96 | -#elif defined(__ppc__) || defined(__PPC__) | ||
97 | +#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__) | ||
98 | #define ABSL_STACKTRACE_INL_HEADER \ | ||
99 | "absl/debugging/internal/stacktrace_powerpc-inl.inc" | ||
100 | #elif defined(__aarch64__) | ||
101 | -- | ||
102 | 2.25.1 | ||
103 | |||