summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-03-13 00:42:25 -0800
committerKhem Raj <raj.khem@gmail.com>2021-03-13 00:56:14 -0800
commit70af4c73c70c7884435ed4eccd52d8a964e160d1 (patch)
tree3717ad7b68b0b24dc770d502bd87906a4a90a21b
parent0587a7c65a6dd33eab6c9a21bf8be384d85d0b06 (diff)
downloadmeta-openembedded-70af4c73c70c7884435ed4eccd52d8a964e160d1.tar.gz
gperftools: Update SRCREV to point to 2.9.1 release
Refresh patches Drop upstreamed patch 0001-profile-handler-Specify-libc-specific-thread_id.patch Fix build on musl/ppc Disable heap and cpu profilers on ppc64le/musl since it does not build stacktrace utility yet Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch6
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch13
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch38
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch4
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch66
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/sgidef.patch2
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools_2.9.1.bb9
7 files changed, 79 insertions, 59 deletions
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
index ab3ceb964f..e3e857f0c2 100644
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
+++ b/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
@@ -11,11 +11,9 @@ Upstream-Status: Pending
11 configure.ac | 2 ++ 11 configure.ac | 2 ++
12 1 file changed, 2 insertions(+) 12 1 file changed, 2 insertions(+)
13 13
14diff --git a/configure.ac b/configure.ac
15index 70b49a3..8154c5c 100644
16--- a/configure.ac 14--- a/configure.ac
17+++ b/configure.ac 15+++ b/configure.ac
18@@ -51,6 +51,8 @@ case "$host" in 16@@ -53,6 +53,8 @@ case "$host" in
19 *-cygwin*) default_enable_heap_checker=no; default_enable_cpu_profiler=no;; 17 *-cygwin*) default_enable_heap_checker=no; default_enable_cpu_profiler=no;;
20 *-freebsd*) default_enable_heap_checker=no;; 18 *-freebsd*) default_enable_heap_checker=no;;
21 *-darwin*) default_enable_heap_checker=no;; 19 *-darwin*) default_enable_heap_checker=no;;
@@ -23,4 +21,4 @@ index 70b49a3..8154c5c 100644
23+ default_enable_debugalloc=no; default_enable_libunwind=no; 21+ default_enable_debugalloc=no; default_enable_libunwind=no;
24 esac 22 esac
25 23
26 # Currently only backtrace works on s390. 24 # Currently only backtrace works on s390 and OSX.
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch
index cb4ead3176..baaaa4b53b 100644
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch
+++ b/meta-oe/recipes-support/gperftools/gperftools/0001-fix-build-with-musl-libc.patch
@@ -10,13 +10,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
10 src/malloc_hook_mmap_linux.h | 6 +++++- 10 src/malloc_hook_mmap_linux.h | 6 +++++-
11 1 file changed, 5 insertions(+), 1 deletion(-) 11 1 file changed, 5 insertions(+), 1 deletion(-)
12 12
13diff --git a/src/malloc_hook_mmap_linux.h b/src/malloc_hook_mmap_linux.h
14index e2efb05..66b3110 100644
15--- a/src/malloc_hook_mmap_linux.h 13--- a/src/malloc_hook_mmap_linux.h
16+++ b/src/malloc_hook_mmap_linux.h 14+++ b/src/malloc_hook_mmap_linux.h
17@@ -46,6 +46,10 @@ 15@@ -45,6 +45,10 @@
18 #include <errno.h> 16 #include <sys/syscall.h>
19 #include "base/linux_syscall_support.h" 17 #include <unistd.h>
20 18
21+#ifndef __GLIBC__ 19+#ifndef __GLIBC__
22+typedef off64_t __off64_t; 20+typedef off64_t __off64_t;
@@ -25,7 +23,7 @@ index e2efb05..66b3110 100644
25 // The x86-32 case and the x86-64 case differ: 23 // The x86-32 case and the x86-64 case differ:
26 // 32b has a mmap2() syscall, 64b does not. 24 // 32b has a mmap2() syscall, 64b does not.
27 // 64b and 32b have different calling conventions for mmap(). 25 // 64b and 32b have different calling conventions for mmap().
28@@ -175,7 +179,7 @@ extern "C" void* mmap64(void *start, size_t length, int prot, int flags, 26@@ -175,7 +179,7 @@ extern "C" void* mmap64(void *start, siz
29 return result; 27 return result;
30 } 28 }
31 29
@@ -34,6 +32,3 @@ index e2efb05..66b3110 100644
34 32
35 extern "C" void* mmap(void *start, size_t length, int prot, int flags, 33 extern "C" void* mmap(void *start, size_t length, int prot, int flags,
36 int fd, off_t offset) __THROW { 34 int fd, off_t offset) __THROW {
37--
382.17.1
39
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch
deleted file mode 100644
index 4029a69c5c..0000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-profile-handler-Specify-libc-specific-thread_id.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 0a504852ed6e56620d1df26b503c4aa2b5b74760 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 31 Oct 2020 16:12:36 -0700
4Subject: [PATCH] profile-handler: Specify libc specific thread_id
5
6We need to know internal _sigev_un is glibc specific, add an else for
7musl case
8
9Fixes build issue
10../git/src/profile-handler.cc:275:8: error: no member named '_sigev_un' in 'sigevent'
11 sevp._sigev_un._tid = sys_gettid();
12 ~~~~ ^
13
14Upstream-Status: Pending
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 src/profile-handler.cc | 4 ++++
18 1 file changed, 4 insertions(+)
19
20diff --git a/src/profile-handler.cc b/src/profile-handler.cc
21index 7fdcb69..5867118 100644
22--- a/src/profile-handler.cc
23+++ b/src/profile-handler.cc
24@@ -272,7 +272,11 @@ static void StartLinuxThreadTimer(int timer_type, int signal_number,
25 struct itimerspec its;
26 memset(&sevp, 0, sizeof(sevp));
27 sevp.sigev_notify = SIGEV_THREAD_ID;
28+#ifdef __GLIBC__
29 sevp._sigev_un._tid = sys_gettid();
30+#else
31+ sevp.sigev_notify_thread_id = sys_gettid();
32+#endif
33 sevp.sigev_signo = signal_number;
34 clockid_t clock = CLOCK_THREAD_CPUTIME_ID;
35 if (timer_type == ITIMER_REAL) {
36--
372.29.2
38
diff --git a/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch b/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
index c3c5784186..15eacc8993 100644
--- a/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
+++ b/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
@@ -12,11 +12,9 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 configure.ac | 5 +++++ 12 configure.ac | 5 +++++
13 1 file changed, 5 insertions(+) 13 1 file changed, 5 insertions(+)
14 14
15diff --git a/configure.ac b/configure.ac
16index 8154c5c..063b260 100644
17--- a/configure.ac 15--- a/configure.ac
18+++ b/configure.ac 16+++ b/configure.ac
19@@ -69,6 +69,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __PPC64__])], 17@@ -76,6 +76,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [re
20 [default_enable_libunwind=yes 18 [default_enable_libunwind=yes
21 default_tcmalloc_pagesize=8]) 19 default_tcmalloc_pagesize=8])
22 20
diff --git a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
new file mode 100644
index 0000000000..4cf182ad64
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
@@ -0,0 +1,66 @@
1Compatibility fixes for musl.
2
3--- a/m4/pc_from_ucontext.m4
4+++ b/m4/pc_from_ucontext.m4
5@@ -34,6 +34,7 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
6 pc_fields="$pc_fields uc_mcontext.arm_pc" # Linux (arm arch 5)
7 pc_fields="$pc_fields uc_mcontext.cr0_hi" # Linux (e2k)
8 pc_fields="$pc_fields uc_mcontext.gp_regs[[PT_NIP]]" # Suse SLES 11 (ppc64)
9+ pc_fields="$pc_fields uc_mcontext.gregs[[PT_NIP]]"
10 pc_fields="$pc_fields uc_mcontext.mc_eip" # FreeBSD (i386)
11 pc_fields="$pc_fields uc_mcontext.mc_srr0" # FreeBSD (powerpc, powerpc64)
12 pc_fields="$pc_fields uc_mcontext.mc_rip" # FreeBSD (x86_64 [untested])
13@@ -77,7 +78,8 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
14 pc_field_found=true)
15 elif test "x$ac_cv_header_ucontext_h" = xyes; then
16 AC_TRY_COMPILE([#define _GNU_SOURCE 1
17- #include <ucontext.h>],
18+ #include <ucontext.h>
19+ #include <asm/ptrace.h>],
20 [ucontext_t u; return u.$pc_field == 0;],
21 AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field,
22 How to access the PC from a struct ucontext)
23--- a/src/getpc.h
24+++ b/src/getpc.h
25@@ -68,6 +68,9 @@
26 typedef ucontext ucontext_t;
27 #endif
28
29+#if defined(__powerpc__) && !defined(PT_NIP)
30+#define PT_NIP 32
31+#endif
32
33 // Take the example where function Foo() calls function Bar(). For
34 // many architectures, Bar() is responsible for setting up and tearing
35--- a/src/stacktrace_powerpc-linux-inl.h
36+++ b/src/stacktrace_powerpc-linux-inl.h
37@@ -186,7 +186,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
38 ucontext_t uc;
39 // We don't care about the rest, since the IP value is at 'uc' field.
40 } *sigframe = reinterpret_cast<signal_frame_64*>(current);
41- result[n] = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_NIP];
42+ result[n] = (void*) sigframe->uc.uc_mcontext.gp_regs[32];
43 }
44 #else
45 if (sigtramp32_vdso && (sigtramp32_vdso == current->return_addr)) {
46@@ -196,7 +196,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
47 mcontext_t mctx;
48 // We don't care about the rest, since IP value is at 'mctx' field.
49 } *sigframe = reinterpret_cast<signal_frame_32*>(current);
50- result[n] = (void*) sigframe->mctx.gregs[PT_NIP];
51+ result[n] = (void*) sigframe->mctx.gregs[32];
52 } else if (sigtramp32_rt_vdso && (sigtramp32_rt_vdso == current->return_addr)) {
53 struct rt_signal_frame_32 {
54 char dummy[64 + 16];
55@@ -204,7 +204,11 @@ static int GET_STACK_TRACE_OR_FRAMES {
56 ucontext_t uc;
57 // We don't care about the rest, since IP value is at 'uc' field.A
58 } *sigframe = reinterpret_cast<rt_signal_frame_32*>(current);
59+#if defined(__GLIBC__)
60 result[n] = (void*) sigframe->uc.uc_mcontext.uc_regs->gregs[PT_NIP];
61+#else
62+ result[n] = (void*) sigframe->uc.uc_mcontext.gregs[32];
63+#endif
64 }
65 #endif
66
diff --git a/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch b/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch
index 10274a6dec..b01cba39cd 100644
--- a/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch
+++ b/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch
@@ -10,8 +10,6 @@ Upstream-Status: Pending
10 src/base/linux_syscall_support.h | 2 +- 10 src/base/linux_syscall_support.h | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-) 11 1 file changed, 1 insertion(+), 1 deletion(-)
12 12
13diff --git a/src/base/linux_syscall_support.h b/src/base/linux_syscall_support.h
14index 70431ca..b23ca59 100644
15--- a/src/base/linux_syscall_support.h 13--- a/src/base/linux_syscall_support.h
16+++ b/src/base/linux_syscall_support.h 14+++ b/src/base/linux_syscall_support.h
17@@ -164,7 +164,7 @@ extern "C" { 15@@ -164,7 +164,7 @@ extern "C" {
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.9.1.bb b/meta-oe/recipes-support/gperftools/gperftools_2.9.1.bb
index 97942278db..bf8cb90178 100644
--- a/meta-oe/recipes-support/gperftools/gperftools_2.9.1.bb
+++ b/meta-oe/recipes-support/gperftools/gperftools_2.9.1.bb
@@ -8,16 +8,19 @@ Included are an optimized thread-caching malloc() and cpu and heap profiling uti
8LICENSE = "BSD-3-Clause" 8LICENSE = "BSD-3-Clause"
9LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a" 9LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
10 10
11SRCREV = "d8eb315fb18f6fb0d6efa923401f166343727bc6" 11DEPENDS_append_libc-musl = " libucontext"
12
13SRCREV = "f7c6fb6c8e99d6b1b725e5994373bcd19ffdf8fd"
12SRC_URI = "git://github.com/gperftools/gperftools \ 14SRC_URI = "git://github.com/gperftools/gperftools \
13 file://0001-Support-Atomic-ops-on-clang.patch \ 15 file://0001-Support-Atomic-ops-on-clang.patch \
14 file://0001-fix-build-with-musl-libc.patch \ 16 file://0001-fix-build-with-musl-libc.patch \
15 file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \ 17 file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
16 file://disable_libunwind_aarch64.patch \ 18 file://disable_libunwind_aarch64.patch \
17 file://sgidef.patch \ 19 file://sgidef.patch \
18 file://0001-profile-handler-Specify-libc-specific-thread_id.patch \
19 " 20 "
20 21
22SRC_URI_append_libc-musl = " file://ppc-musl.patch"
23
21inherit autotools 24inherit autotools
22 25
23S = "${WORKDIR}/git" 26S = "${WORKDIR}/git"
@@ -36,6 +39,7 @@ COMPATIBLE_HOST_riscv32 = "null"
36ARM_INSTRUCTION_SET_armv5 = "arm" 39ARM_INSTRUCTION_SET_armv5 = "arm"
37ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm" 40ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm"
38 41
42EXTRA_OECONF_append_libc-musl_powerpc64le = " --disable-cpu-profiler --disable-heap-profiler --disable-heap-checker"
39PACKAGECONFIG ?= "libunwind static" 43PACKAGECONFIG ?= "libunwind static"
40PACKAGECONFIG_remove_arm_libc-musl = "libunwind" 44PACKAGECONFIG_remove_arm_libc-musl = "libunwind"
41PACKAGECONFIG_remove_riscv64 = "libunwind" 45PACKAGECONFIG_remove_riscv64 = "libunwind"
@@ -60,4 +64,3 @@ RDEPENDS_${PN} += " \
60" 64"
61 65
62RDEPENDS_${PN} += "libtcmalloc-minimal (= ${EXTENDPKGV})" 66RDEPENDS_${PN} += "libtcmalloc-minimal (= ${EXTENDPKGV})"
63