All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 1/2] abseil-cpp: Fix build on musl and ppc64
@ 2021-03-13 18:30 Khem Raj
  2021-03-13 18:30 ` [meta-python][PATCH 2/2] python3-grpcio,python3-grpcio-tools: Enable build on ppc64/glibc Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-03-13 18:30 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../abseil-cpp/abseil-ppc-fixes.patch         | 94 +++++++++++++++++++
 .../abseil-cpp/abseil-cpp_git.bb              |  1 +
 2 files changed, 95 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/abseil-ppc-fixes.patch

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..ee0c25473b
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/abseil-ppc-fixes.patch
@@ -0,0 +1,94 @@
+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,7 @@
+ 
+ // The following platforms have an implementation of a hardware counter.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
+-  defined(__powerpc__) || defined(__ppc__) || \
++  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
+   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"
+@@ -55,8 +59,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.regs->nip);
++#elif defined(__powerpc__)
++    return reinterpret_cast<void*>(((struct pt_regs *)context->uc_regs)->nip);
+ #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
+@@ -64,7 +64,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__)
+--- a/absl/debugging/internal/stacktrace_powerpc-inl.inc
++++ b/absl/debugging/internal/stacktrace_powerpc-inl.inc
+@@ -130,8 +130,13 @@ static void **NextStackFrame(void **old_
+         StacktracePowerPCGetLR(new_sp) == kernel_sigtramp_rt64_address) {
+       const ucontext_t* signal_context =
+           reinterpret_cast<const ucontext_t*>(uc);
++#if defined(__powerpc64__)
+       void **const sp_before_signal =
+           reinterpret_cast<void**>(signal_context->uc_mcontext.gp_regs[PT_R1]);
++#else
++      void **const sp_before_signal =
++          reinterpret_cast<void**>(signal_context->uc_mcontext.uc_regs->gregs[PT_R1]);
++#endif
+       // Check that alleged sp before signal is nonnull and is reasonably
+       // aligned.
+       if (sp_before_signal != nullptr &&
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
index 6a1a029566..b944b3c15e 100644
--- a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
@@ -13,6 +13,7 @@ BRANCH = "lts_2020_09_23"
 SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH}         \
            file://0001-absl-always-use-asm-sgidefs.h.patch             \
            file://0002-Remove-maes-option-from-cross-compilation.patch \
+           file://file://abseil-ppc-fixes.patch \
           "
 
 S = "${WORKDIR}/git"
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [meta-python][PATCH 2/2] python3-grpcio,python3-grpcio-tools: Enable build on ppc64/glibc
  2021-03-13 18:30 [meta-oe][PATCH 1/2] abseil-cpp: Fix build on musl and ppc64 Khem Raj
@ 2021-03-13 18:30 ` Khem Raj
  2021-03-15 13:03   ` [oe] " Trevor Gamblin
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-03-13 18:30 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

We can compile abseil-cpp now for ppc64

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../recipes-core/packagegroups/packagegroup-meta-python.bb    | 2 +-
 .../recipes-devtools/python/python3-grpcio-tools_1.35.0.bb    | 4 ++--
 meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
index df4fcc8826..c6ac19a225 100644
--- a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
+++ b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
@@ -449,7 +449,7 @@ RDEPENDS_packagegroup-meta-python3 = "\
     python3-zopeinterface \
     telepathy-python3 \
 "
-RDEPENDS_packagegroup-meta-python3_remove_powerpc64le = "python3-grpcio python3-grpcio-tools"
+RDEPENDS_packagegroup-meta-python3_remove_libc-musl_powerpc64le = "python3-grpcio python3-grpcio-tools"
 
 RDEPENDS_packagegroup-meta-python3-ptest = "\
     python3-cryptography-ptest \
diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb
index 475b4e6063..6758429aef 100644
--- a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb
+++ b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb
@@ -17,6 +17,6 @@ RDEPENDS_${PN} = "${PYTHON_PN}-grpcio"
 
 BBCLASSEXTEND = "native nativesdk"
 
-# Needs python3-grpcio which does not build for ppc64le
-COMPATIBLE_HOST_powerpc64le = "null"
+# Needs abseil-cpp which does not build for ppc64le/musl
+COMPATIBLE_HOST_libc-musl_powerpc64le = "null"
 
diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb
index fa030b99e2..13cef537e2 100644
--- a/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb
+++ b/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb
@@ -44,6 +44,6 @@ BBCLASSEXTEND = "native nativesdk"
 
 CCACHE_DISABLE = "1"
 
-# abseil-cpp/absl/base/internal/unscaledcycleclock.cc:100:2: error: #error Must implement UnscaledCycleClock::Frequency()
-COMPATIBLE_HOST_powerpc64le = "null"
+# needs vdso support
+COMPATIBLE_HOST_libc-musl_powerpc64le = "null"
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [oe] [meta-python][PATCH 2/2] python3-grpcio,python3-grpcio-tools: Enable build on ppc64/glibc
  2021-03-13 18:30 ` [meta-python][PATCH 2/2] python3-grpcio,python3-grpcio-tools: Enable build on ppc64/glibc Khem Raj
@ 2021-03-15 13:03   ` Trevor Gamblin
  0 siblings, 0 replies; 3+ messages in thread
From: Trevor Gamblin @ 2021-03-15 13:03 UTC (permalink / raw)
  To: Khem Raj, openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]


On 2021-03-13 1:30 p.m., Khem Raj wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
>
> We can compile abseil-cpp now for ppc64
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Trevor Gamblin <trevor.gamblin@windriver.com>
> ---
>   .../recipes-core/packagegroups/packagegroup-meta-python.bb    | 2 +-
>   .../recipes-devtools/python/python3-grpcio-tools_1.35.0.bb    | 4 ++--
>   meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb  | 4 ++--
>   3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
> index df4fcc8826..c6ac19a225 100644
> --- a/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
> +++ b/meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb
> @@ -449,7 +449,7 @@ RDEPENDS_packagegroup-meta-python3 = "\
>       python3-zopeinterface \
>       telepathy-python3 \
>   "
> -RDEPENDS_packagegroup-meta-python3_remove_powerpc64le = "python3-grpcio python3-grpcio-tools"
> +RDEPENDS_packagegroup-meta-python3_remove_libc-musl_powerpc64le = "python3-grpcio python3-grpcio-tools"
>
>   RDEPENDS_packagegroup-meta-python3-ptest = "\
>       python3-cryptography-ptest \
> diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb
> index 475b4e6063..6758429aef 100644
> --- a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb
> +++ b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.35.0.bb
> @@ -17,6 +17,6 @@ RDEPENDS_${PN} = "${PYTHON_PN}-grpcio"
>
>   BBCLASSEXTEND = "native nativesdk"
>
> -# Needs python3-grpcio which does not build for ppc64le
> -COMPATIBLE_HOST_powerpc64le = "null"
> +# Needs abseil-cpp which does not build for ppc64le/musl
> +COMPATIBLE_HOST_libc-musl_powerpc64le = "null"
>
> diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb
> index fa030b99e2..13cef537e2 100644
> --- a/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb
> +++ b/meta-python/recipes-devtools/python/python3-grpcio_1.36.1.bb
> @@ -44,6 +44,6 @@ BBCLASSEXTEND = "native nativesdk"
>
>   CCACHE_DISABLE = "1"
>
> -# abseil-cpp/absl/base/internal/unscaledcycleclock.cc:100:2: error: #error Must implement UnscaledCycleClock::Frequency()
> -COMPATIBLE_HOST_powerpc64le = "null"
> +# needs vdso support
> +COMPATIBLE_HOST_libc-musl_powerpc64le = "null"
>
> --
> 2.30.2
>
>
> 
>

[-- Attachment #2: Type: text/html, Size: 3468 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-15 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-13 18:30 [meta-oe][PATCH 1/2] abseil-cpp: Fix build on musl and ppc64 Khem Raj
2021-03-13 18:30 ` [meta-python][PATCH 2/2] python3-grpcio,python3-grpcio-tools: Enable build on ppc64/glibc Khem Raj
2021-03-15 13:03   ` [oe] " Trevor Gamblin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.