aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-devtools/abseil-cpp/abseil-cpp')
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Add-RISCV-support-to-GetProgramCounter.patch29
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch74
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch53
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch13
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch35
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch39
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Add-fPIC-option.patch27
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch49
-rw-r--r--meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/abseil-ppc-fixes.patch81
9 files changed, 176 insertions, 224 deletions
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Add-RISCV-support-to-GetProgramCounter.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Add-RISCV-support-to-GetProgramCounter.patch
deleted file mode 100644
index 95ec070f6c..0000000000
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Add-RISCV-support-to-GetProgramCounter.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 983eeae0792946fe5c090f95164c892ec6db5cc4 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 16 Feb 2020 16:22:53 -0800
-Subject: [PATCH] Add RISCV support to GetProgramCounter()
-
-Identify PC register from signal context
-
-Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/621]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- absl/debugging/internal/examine_stack.cc | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
-index 4739fbc..fb77450 100644
---- a/absl/debugging/internal/examine_stack.cc
-+++ b/absl/debugging/internal/examine_stack.cc
-@@ -53,6 +53,8 @@ void* GetProgramCounter(void* vuc) {
- return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
- #elif defined(__powerpc__)
- return reinterpret_cast<void*>(context->uc_mcontext.regs->nip);
-+#elif defined(__riscv)
-+ return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
- #elif defined(__s390__) && !defined(__s390x__)
- return reinterpret_cast<void*>(context->uc_mcontext.psw.addr & 0x7fffffff);
- #elif defined(__s390__) && defined(__s390x__)
---
-2.25.0
-
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch
deleted file mode 100644
index e7c9b43c29..0000000000
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Fix-build-on-riscv32.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 04e28fdda03b545a0f7b446a784ec2fa7249cbb8 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 29 Apr 2020 15:37:40 -0700
-Subject: [PATCH] Fix build on riscv32
-
-Define __NR_mmap in terms of __NR_mmap2 and __NR_futex interms of
-__NR_futex_time64 for rv32, since there calls dont exist for rv32
-
-Also recognise rv32 as a new 32bit platform
-
-Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/675]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- absl/base/internal/direct_mmap.h | 5 +++++
- absl/base/internal/spinlock_linux.inc | 4 ++++
- absl/synchronization/internal/waiter.cc | 4 ++++
- 3 files changed, 13 insertions(+)
-
-diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
-index 5618867..90cfeca 100644
---- a/absl/base/internal/direct_mmap.h
-+++ b/absl/base/internal/direct_mmap.h
-@@ -26,6 +26,10 @@
-
- #ifdef __linux__
-
-+#if !defined(__NR_mmap) && defined(__riscv) && __riscv_xlen == 32
-+# define __NR_mmap __NR_mmap2
-+#endif
-+
- #include <sys/types.h>
- #ifdef __BIONIC__
- #include <sys/syscall.h>
-@@ -72,6 +76,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
- #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
- (defined(__PPC__) && !defined(__PPC64__)) || \
-+ (defined(__riscv) && __riscv_xlen == 32) || \
- (defined(__s390__) && !defined(__s390x__))
- // On these architectures, implement mmap with mmap2.
- static int pagesize = 0;
-diff --git a/absl/base/internal/spinlock_linux.inc b/absl/base/internal/spinlock_linux.inc
-index 323edd6..3dca444 100644
---- a/absl/base/internal/spinlock_linux.inc
-+++ b/absl/base/internal/spinlock_linux.inc
-@@ -14,6 +14,10 @@
- //
- // This file is a Linux-specific part of spinlock_wait.cc
-
-+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
-+# define __NR_futex __NR_futex_time64
-+#endif
-+
- #include <linux/futex.h>
- #include <sys/syscall.h>
- #include <unistd.h>
-diff --git a/absl/synchronization/internal/waiter.cc b/absl/synchronization/internal/waiter.cc
-index 2949f5a..7411042 100644
---- a/absl/synchronization/internal/waiter.cc
-+++ b/absl/synchronization/internal/waiter.cc
-@@ -24,6 +24,10 @@
- #include <unistd.h>
- #endif
-
-+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
-+# define __NR_futex __NR_futex_time64
-+#endif
-+
- #ifdef __linux__
- #include <linux/futex.h>
- #include <sys/syscall.h>
---
-2.26.2
-
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
deleted file mode 100644
index 4c41cd8902..0000000000
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 70926666f7c5c35add363e3bcade6eaabace7206 Mon Sep 17 00:00:00 2001
-From: Sinan Kaya <sinan.kaya@microsoft.com>
-Date: Mon, 3 Feb 2020 03:25:57 +0000
-Subject: [PATCH] Remove maes option from cross-compilation
-
----
- absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
- absl/copts/GENERATED_copts.bzl | 4 ----
- absl/copts/copts.py | 4 ----
- 3 files changed, 12 deletions(-)
-
-diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
-index 01bd40b..af99694 100644
---- a/absl/copts/GENERATED_AbseilCopts.cmake
-+++ b/absl/copts/GENERATED_AbseilCopts.cmake
-@@ -230,7 +230,3 @@ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
- "/Ob2"
- )
-
--list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
-- "-maes"
-- "-msse4.1"
--)
-diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
-index 82f332f..9a548d1 100644
---- a/absl/copts/GENERATED_copts.bzl
-+++ b/absl/copts/GENERATED_copts.bzl
-@@ -231,7 +231,3 @@ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
- "/Ob2",
- ]
-
--ABSL_RANDOM_HWAES_X64_FLAGS = [
-- "-maes",
-- "-msse4.1",
--]
-diff --git a/absl/copts/copts.py b/absl/copts/copts.py
-index 068abce..c2f70fb 100644
---- a/absl/copts/copts.py
-+++ b/absl/copts/copts.py
-@@ -203,10 +203,6 @@ COPT_VARS = {
- # to improve performance of some random bit generators.
- "ABSL_RANDOM_HWAES_ARM64_FLAGS": ["-march=armv8-a+crypto"],
- "ABSL_RANDOM_HWAES_ARM32_FLAGS": ["-mfpu=neon"],
-- "ABSL_RANDOM_HWAES_X64_FLAGS": [
-- "-maes",
-- "-msse4.1",
-- ],
- "ABSL_RANDOM_HWAES_MSVC_X64_FLAGS": [
- "/O2", # Maximize speed
- "/Ob2", # Aggressive inlining
---
-2.23.0
-
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
index 6bb59d9336..5242b29e06 100644
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
@@ -1,7 +1,7 @@
-From 14229e8c6f42a96e4d725124193ceefa54e5e1a4 Mon Sep 17 00:00:00 2001
+From 738549dea7a4e6c462a79962c414eaa450c2cffd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 9 Apr 2020 13:06:27 -0700
-Subject: [PATCH] absl: always use <asm/sgidefs.h>
+Subject: [PATCH 1/3] absl: always use <asm/sgidefs.h>
Fixes mips/musl build, since sgidefs.h is not present on all C libraries
but on linux asm/sgidefs.h is there and contains same definitions, using
@@ -10,29 +10,30 @@ that makes it portable.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
---
absl/base/internal/direct_mmap.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
-index 2e5e422..c515325 100644
+index e492bb0..c8a4fba 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -41,13 +41,9 @@
#ifdef __mips__
// Include definitions of the ABI currently in use.
--#ifdef __BIONIC__
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
+// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
// definitions we need.
#include <asm/sgidefs.h>
-#else
-#include <sgidefs.h>
--#endif // __BIONIC__
+-#endif // __BIONIC__ || !__GLIBC__
#endif // __mips__
// SYS_mmap and SYS_munmap are not defined in Android.
--
-2.26.0
+2.25.1
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
deleted file mode 100644
index fab4a738ea..0000000000
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 9384735383a0b8688e3f05ed23a53f18863eae20 Mon Sep 17 00:00:00 2001
-From: Sinan Kaya <sinan.kaya@microsoft.com>
-Date: Tue, 11 Feb 2020 11:36:00 -0500
-Subject: [PATCH] Add forgotten ABSL_HAVE_VDSO_SUPPORT conditional
-
-Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
----
- absl/debugging/internal/stacktrace_x86-inl.inc | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/absl/debugging/internal/stacktrace_x86-inl.inc b/absl/debugging/internal/stacktrace_x86-inl.inc
-index ff0fd31..28607c3 100644
---- a/absl/debugging/internal/stacktrace_x86-inl.inc
-+++ b/absl/debugging/internal/stacktrace_x86-inl.inc
-@@ -171,6 +171,7 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
- static const unsigned char *kernel_rt_sigreturn_address = nullptr;
- static const unsigned char *kernel_vsyscall_address = nullptr;
- if (num_push_instructions == -1) {
-+#ifdef ABSL_HAVE_VDSO_SUPPORT
- absl::debugging_internal::VDSOSupport vdso;
- if (vdso.IsPresent()) {
- absl::debugging_internal::VDSOSupport::SymbolInfo
-@@ -199,6 +200,9 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
- } else {
- num_push_instructions = 0;
- }
-+#else
-+ num_push_instructions = 0;
-+#endif
- }
- if (num_push_instructions != 0 && kernel_rt_sigreturn_address != nullptr &&
- old_fp[1] == kernel_rt_sigreturn_address) {
---
-2.20.1.windows.1
-
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
new file mode 100644
index 0000000000..b92a487523
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
@@ -0,0 +1,39 @@
+From d25cf3b9aa873595a19e197cc29ab46c0093bff1 Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <sinan.kaya@microsoft.com>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH 2/3] Remove maes option from cross-compilation
+
+---
+Upstream-Status: Pending
+
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index a4ab1aa2041e..23b9253c1f00 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -158,7 +158,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+- "-maes"
+- "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index a6efc98e11d4..1e847f769501 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -159,7 +159,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+- "-maes",
+- "-msse4.1",
+-]
+--
+2.36.1
+
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Add-fPIC-option.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Add-fPIC-option.patch
deleted file mode 100644
index bb78813a7f..0000000000
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Add-fPIC-option.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From d7160d647c8f8847f3ea8d7b0eb222936962c1af Mon Sep 17 00:00:00 2001
-From: Sinan Kaya <sinan.kaya@microsoft.com>
-Date: Tue, 11 Feb 2020 11:58:02 -0500
-Subject: [PATCH] Add fPIC option
-
-Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
----
- CMakeLists.txt | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 74a3a4c..4f837b3 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -79,6 +79,9 @@ option(ABSL_USE_GOOGLETEST_HEAD
-
- option(ABSL_RUN_TESTS "If ON, Abseil tests will be run." OFF)
-
-+# link fails on arm64 and x86-64 without this
-+add_compile_options(-fPIC)
-+
- if(${ABSL_RUN_TESTS})
- # enable CTest. This will set BUILD_TESTING to ON unless otherwise specified
- # on the command line
---
-2.20.1.windows.1
-
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
new file mode 100644
index 0000000000..1a80a428b7
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
@@ -0,0 +1,49 @@
+From fb24c3e3539b5743d398a429a302a3886186f261 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski@bisdn.de>
+Date: Thu, 16 Jun 2022 11:46:31 +0000
+Subject: [PATCH 3/3] Remove neon option from cross compilation
+
+Not every arm platform supports neon instructions, so do not enforce
+them.
+
+Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
+---
+Upstream-Status: Pending
+
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index 23b9253c1f00..5d112a97f3e4 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -147,10 +147,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
+ "/DNOMINMAX"
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
+- "-mfpu=neon"
+-)
+-
+ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ "-march=armv8-a+crypto"
+ )
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index 1e847f769501..3e10db204faf 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -148,10 +148,6 @@ ABSL_MSVC_TEST_FLAGS = [
+ "/DNOMINMAX",
+ ]
+
+-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
+- "-mfpu=neon",
+-]
+-
+ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ "-march=armv8-a+crypto",
+ ]
+--
+2.36.1
+
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/abseil-ppc-fixes.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/abseil-ppc-fixes.patch
new file mode 100644
index 0000000000..f2ebd9f08c
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/abseil-ppc-fixes.patch
@@ -0,0 +1,81 @@
+Upstream-Status: Pending
+
+An all-in-one patch that fixes several issues:
+
+1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
+2) powerpc stacktrace implementation only works on glibc (disabled on musl)
+3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
+4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
+
+Sourced from void linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/absl/base/internal/unscaledcycleclock.cc
++++ b/absl/base/internal/unscaledcycleclock.cc
+@@ -20,7 +20,7 @@
+ #include <intrin.h>
+ #endif
+
+-#if defined(__powerpc__) || defined(__ppc__)
++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
+ return base_internal::NominalCPUFrequency();
+ }
+
+-#elif defined(__powerpc__) || defined(__ppc__)
++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+
+ int64_t UnscaledCycleClock::Now() {
+ #ifdef __GLIBC__
+--- a/absl/base/internal/unscaledcycleclock_config.h
++++ b/absl/base/internal/unscaledcycleclock_config.h
+@@ -21,7 +21,8 @@
+
+ // The following platforms have an implementation of a hardware counter.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
+- defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \
++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
++ defined(__riscv) || \
+ defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC))
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -33,6 +33,10 @@
+ #include <csignal>
+ #include <cstdio>
+
++#if defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #include "absl/base/attributes.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/macros.h"
+@@ -174,8 +178,10 @@ void* GetProgramCounter(void* const vuc) {
+ return reinterpret_cast<void*>(context->uc_mcontext.pc);
+ #elif defined(__powerpc64__)
+ return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+ return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
++#elif defined(__powerpc__)
++ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
+ #elif defined(__riscv)
+ return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
+ #elif defined(__s390__) && !defined(__s390x__)
+--- a/absl/debugging/internal/stacktrace_config.h
++++ b/absl/debugging/internal/stacktrace_config.h
+@@ -60,7 +60,7 @@
+ #elif defined(__i386__) || defined(__x86_64__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+ "absl/debugging/internal/stacktrace_x86-inl.inc"
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+ "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+ #elif defined(__aarch64__)