summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio')
-rw-r--r--meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch17
-rw-r--r--meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch79
2 files changed, 84 insertions, 12 deletions
diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch b/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
index 373669461b..febe6c4c87 100644
--- a/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
+++ b/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch
@@ -28,11 +28,9 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
src/python/grpcio/commands.py | 5 ++++-
2 files changed, 10 insertions(+), 4 deletions(-)
-diff --git a/setup.py b/setup.py
-index 4b8c9d4..271b7b1 100644
--- a/setup.py
+++ b/setup.py
-@@ -172,8 +172,11 @@ def check_linker_need_libatomic():
+@@ -199,8 +199,11 @@ def check_linker_need_libatomic():
"""Test if linker on system needs libatomic."""
code_test = (b'#include <atomic>\n' +
b'int main() { return std::atomic<int64_t>{}; }')
@@ -46,20 +44,18 @@ index 4b8c9d4..271b7b1 100644
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
-@@ -183,7 +186,7 @@ def check_linker_need_libatomic():
+@@ -210,7 +213,7 @@ def check_linker_need_libatomic():
# Double-check to see if -latomic actually can solve the problem.
# https://github.com/grpc/grpc/issues/22491
cpp_test = subprocess.Popen(
-- [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'],
-+ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-latomic', '-'],
+- [cxx, '-x', 'c++', '-std=c++11', '-', '-latomic'],
++ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-', '-latomic'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
-diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
-index a8b2ff5..b928201 100644
--- a/src/python/grpcio/commands.py
+++ b/src/python/grpcio/commands.py
-@@ -219,7 +219,10 @@ class BuildExt(build_ext.build_ext):
+@@ -228,7 +228,10 @@ class BuildExt(build_ext.build_ext):
"""
try:
# TODO(lidiz) Remove the generated a.out for success tests.
@@ -71,6 +67,3 @@ index a8b2ff5..b928201 100644
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
---
-2.30.1
-
diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch b/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch
new file mode 100644
index 0000000000..e8048fe940
--- /dev/null
+++ b/meta-openembedded/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch
@@ -0,0 +1,79 @@
+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__)
+@@ -59,7 +59,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.h
++++ b/absl/base/internal/unscaledcycleclock.h
+@@ -46,7 +46,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)
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -27,6 +27,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"
+@@ -63,8 +67,10 @@ void* GetProgramCounter(void* 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*>(((struct pt_regs *)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
+@@ -59,7 +59,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__)