diff --git a/meta-oe/recipes-support/gperftools/gperftools/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch deleted file mode 100644 index eae71be8fc..0000000000 --- a/meta-oe/recipes-support/gperftools/gperftools/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 02ff9fcc74ba64aeb22fcc553f30657bd2b62930 Mon Sep 17 00:00:00 2001 -From: Chen Qi -Date: Wed, 26 Feb 2025 23:46:56 -0800 -Subject: [PATCH 2/3] src/base/elf_mem_image.cc: fix build for musl - -Include header file for musl to avoid error below: - - error: '__WORDSIZE' was not declared in this scope - -Upstream-Status: Pending - -Signed-off-by: Chen Qi ---- - src/base/elf_mem_image.cc | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/base/elf_mem_image.cc b/src/base/elf_mem_image.cc -index d2ca1a5..89dc0e4 100644 ---- a/src/base/elf_mem_image.cc -+++ b/src/base/elf_mem_image.cc -@@ -38,6 +38,11 @@ - - #ifdef HAVE_ELF_MEM_IMAGE // defined in elf_mem_image.h - -+// for musl __WORDSIZE definition -+#if !defined(__GLIBC__) -+#include -+#endif -+ - #include // for size_t, ptrdiff_t - #include "base/logging.h" - --- -2.25.1 - diff --git a/meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch deleted file mode 100644 index 01ecdd5336..0000000000 --- a/meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 3bb5707c6a6a0d2061c79c556cbe4a87efea02ab Mon Sep 17 00:00:00 2001 -From: Chen Qi -Date: Thu, 27 Feb 2025 00:44:34 -0800 -Subject: [PATCH 3/3] Makefile.am: disable building noinst tests for musl - -Build fails for musl + qemuppc64 about ld failing to find -symbols in libucontext. Until a real solution is found, -we need this workaround. - -Upstream-Status: Inappropriate [OE Specific] - -Signed-off-by: Chen Qi ---- - Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index 9fa24c0..7dd1b60 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -938,7 +938,7 @@ endif WITH_HEAP_PROFILER_OR_CHECKER - # This should always include $(TESTS), but may also include other - # binaries that you compile but don't want automatically installed. - # We'll add to this later, on a library-by-library basis --noinst_PROGRAMS += $(TESTS) -+#noinst_PROGRAMS += $(TESTS) - - # http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki - pkgconfigdir = $(libdir)/pkgconfig --- -2.25.1 - diff --git a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch deleted file mode 100644 index e5061840bc..0000000000 --- a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 1526be49b8c49719459ef15c93090fdbdc10f3cb Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 13 Mar 2021 00:42:25 -0800 -Subject: [PATCH 1/3] Compatibility fixes for musl. - -Upstream-Status: Pending - -Signed-off-by: Chen Qi ---- - src/getpc.h | 4 ++++ - src/stacktrace_powerpc-linux-inl.h | 8 ++++++-- - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/src/getpc.h b/src/getpc.h -index c14c9d0..cf4866b 100644 ---- a/src/getpc.h -+++ b/src/getpc.h -@@ -61,6 +61,10 @@ - typedef ucontext ucontext_t; - #endif - -+#if defined(__powerpc__) && !defined(PT_NIP) -+#define PT_NIP 32 -+#endif -+ - namespace tcmalloc { - namespace getpc { - -diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h -index 883e7d2..212bd25 100644 ---- a/src/stacktrace_powerpc-linux-inl.h -+++ b/src/stacktrace_powerpc-linux-inl.h -@@ -186,7 +186,7 @@ static int GET_STACK_TRACE_OR_FRAMES { - ucontext_t uc; - // We don't care about the rest, since the IP value is at 'uc' field. - } *sigframe = reinterpret_cast(current); -- result[n] = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_NIP]; -+ result[n] = (void*) sigframe->uc.uc_mcontext.gp_regs[32]; - } - #else - if (sigtramp32_vdso && (sigtramp32_vdso == current->return_addr)) { -@@ -196,7 +196,7 @@ static int GET_STACK_TRACE_OR_FRAMES { - mcontext_t mctx; - // We don't care about the rest, since IP value is at 'mctx' field. - } *sigframe = reinterpret_cast(current); -- result[n] = (void*) sigframe->mctx.gregs[PT_NIP]; -+ result[n] = (void*) sigframe->mctx.gregs[32]; - } else if (sigtramp32_rt_vdso && (sigtramp32_rt_vdso == current->return_addr)) { - struct rt_signal_frame_32 { - char dummy[64 + 16]; -@@ -204,7 +204,11 @@ static int GET_STACK_TRACE_OR_FRAMES { - ucontext_t uc; - // We don't care about the rest, since IP value is at 'uc' field.A - } *sigframe = reinterpret_cast(current); -+#if defined(__GLIBC__) - result[n] = (void*) sigframe->uc.uc_mcontext.uc_regs->gregs[PT_NIP]; -+#else -+ result[n] = (void*) sigframe->uc.uc_mcontext.gregs[32]; -+#endif - } - #endif - --- -2.25.1 - diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.18.1.bb b/meta-oe/recipes-support/gperftools/gperftools_2.18.1.bb index f2244c43fa..e4b7060c78 100644 --- a/meta-oe/recipes-support/gperftools/gperftools_2.18.1.bb +++ b/meta-oe/recipes-support/gperftools/gperftools_2.18.1.bb @@ -13,12 +13,6 @@ DEPENDS:append:libc-musl = " libucontext" SRCREV = "d837a42788ba591d5d791c3b686f2738e7a93562" SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https;tag=gperftools-${PV}" -SRC_URI:append:libc-musl = " \ - file://ppc-musl.patch \ - file://0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch \ - file://0003-Makefile.am-disable-building-noinst-tests-for-musl.patch \ - " - inherit autotools @@ -36,6 +30,8 @@ COMPATIBLE_HOST:riscv32 = "null" ARM_INSTRUCTION_SET:armv5 = "arm" ARM_INSTRUCTION_SET:toolchain-clang:arm = "arm" +# Test programs fail to link against libucontext on musl + ppc64 +EXTRA_OECONF:append:libc-musl = " --disable-tests" EXTRA_OECONF:append:libc-musl:powerpc64le = " --disable-cpu-profiler" EXTRA_OECONF:append:libc-musl:powerpc = " --disable-cpu-profiler" PACKAGECONFIG ?= "libunwind static"