summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2024-03-21 19:29:34 +0800
committerKhem Raj <raj.khem@gmail.com>2024-03-21 08:46:06 -0700
commit2037afbc3289769ce1b02173306b5cdaccfbc255 (patch)
treeb05597d64d0e856b2bc13b826388c9c57c047dc2 /meta-oe/recipes-support
parentcb27ff9dcb2258e9cf07dd6ab95bfb408c8232af (diff)
downloadmeta-openembedded-2037afbc3289769ce1b02173306b5cdaccfbc255.tar.gz
gperftools: 2.10 -> 2.15
* Remove 0001-Support-Atomic-ops-on-clang.patch because of: commit 54605b8a5807fe893a4b9ff8def982a264cdc6c9 Author: Aliaksey Kandratsenka <alkondratenko@gmail.com> Date: Wed Jun 21 10:39:18 2023 -0400 amputate old atomic ops implementation * Remove sgidef.patch because of: commit e78238d94d41764dc72edb37e3d6510255d3dcd4 Author: Aliaksey Kandratsenka <alkondratenko@gmail.com> Date: Wed Jun 21 10:39:38 2023 -0400 reworked heap leak checker for more portability * Remove 0001-Define-off64_t-as-off_t-on-musl.patch because of: commit 8be84e4a5c28c33bfdb7da3ee0c92d9620cd552f Author: Aliaksey Kandratsenka <alkondratenko@gmail.com> Date: Fri Jul 21 14:18:12 2023 -0400 drop old mmap hooks and introduce internal & simpler mmap_hook.h * Rebased 0001-Support-Atomic-ops-on-clang.patch for 2.15 * Rebased ppc-musl.patch for 2.15 * Add 0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch to fix build error for 32bit machine. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support')
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-Define-off64_t-as-off_t-on-musl.patch33
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch31
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch8
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch59
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch38
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/sgidef.patch23
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools_2.15.bb (renamed from meta-oe/recipes-support/gperftools/gperftools_2.10.bb)6
7 files changed, 74 insertions, 124 deletions
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-Define-off64_t-as-off_t-on-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-Define-off64_t-as-off_t-on-musl.patch
deleted file mode 100644
index 2b782c204..000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-Define-off64_t-as-off_t-on-musl.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 41260e21e271eb1dc8b34f952ea3f90a0dc35e9e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 25 Dec 2022 20:01:29 -0800
4Subject: [PATCH] Define off64_t as off_t on musl
5
6Musl's default bitlength for off_t is always 64bit therefore define
7off64_t as off_t on musl
8
9Upstream-Status: Submitted [https://github.com/gperftools/gperftools/pull/1379]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/malloc_hook_mmap_linux.h | 5 +++++
13 1 file changed, 5 insertions(+)
14
15diff --git a/src/malloc_hook_mmap_linux.h b/src/malloc_hook_mmap_linux.h
16index c7d8b4b..a10687e 100644
17--- a/src/malloc_hook_mmap_linux.h
18+++ b/src/malloc_hook_mmap_linux.h
19@@ -45,6 +45,11 @@
20 #include <sys/syscall.h>
21 #include <unistd.h>
22
23+// musl's off_t is already 64-bit
24+#if defined(__linux__) && !defined(__GLIBC__)
25+typedef off_t off64_t;
26+#endif
27+
28 // The x86-32 case and the x86-64 case differ:
29 // 32b has a mmap2() syscall, 64b does not.
30 // 64b and 32b have different calling conventions for mmap().
31--
322.39.0
33
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch
deleted file mode 100644
index 2fd21c278..000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-Support-Atomic-ops-on-clang.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From aa0a63209af6813d87255ec3ab339f2dbbf27d6d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 6 Mar 2017 13:38:46 -0800
4Subject: [PATCH] Support Atomic ops on clang
5
6clang pretends to be gcc 4.2 which is a lie
7it actually supports a lot more features then
8gcc 4.2, here it depends on gcc 4.7 to enable
9the atomics and fails for clang
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Upstream-Status: Pending
14
15---
16 src/base/atomicops.h | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/base/atomicops.h b/src/base/atomicops.h
20index dac95be..390733c 100644
21--- a/src/base/atomicops.h
22+++ b/src/base/atomicops.h
23@@ -124,7 +124,7 @@
24 #include "base/atomicops-internals-linuxppc.h"
25 #elif defined(__GNUC__) && defined(__mips__)
26 #include "base/atomicops-internals-mips.h"
27-#elif defined(__GNUC__) && GCC_VERSION >= 40700
28+#elif defined(__GNUC__) && GCC_VERSION >= 40700 || defined(__clang__)
29 #include "base/atomicops-internals-gcc.h"
30 #elif defined(__clang__) && CLANG_VERSION >= 30400
31 #include "base/atomicops-internals-gcc.h"
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 e3e857f0c..2ea54e48c 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,12 +11,14 @@ 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 68fd51c..4cb71fe 100644
14--- a/configure.ac 16--- a/configure.ac
15+++ b/configure.ac 17+++ b/configure.ac
16@@ -53,6 +53,8 @@ case "$host" in 18@@ -53,6 +53,8 @@ case "$host" in
17 *-cygwin*) default_enable_heap_checker=no; default_enable_cpu_profiler=no;; 19 need_nanosleep=no;;
18 *-freebsd*) default_enable_heap_checker=no;; 20 *-cygwin*) default_enable_cpu_profiler=no;;
19 *-darwin*) default_enable_heap_checker=no;; 21 *-linux*) default_enable_heap_checker=yes; heap_checker_supported=yes;;
20+ *-musl*) default_enable_heap_checker=no; default_enable_heap_profiler=no; 22+ *-musl*) default_enable_heap_checker=no; default_enable_heap_profiler=no;
21+ default_enable_debugalloc=no; default_enable_libunwind=no; 23+ default_enable_debugalloc=no; default_enable_libunwind=no;
22 esac 24 esac
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch
new file mode 100644
index 000000000..1142df0be
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch
@@ -0,0 +1,59 @@
1From d675808d300278a9e7143428cfecf3fda61cc9a2 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 21 Mar 2024 10:59:29 +0000
4Subject: [PATCH] src/mmap_hook.cc: Fix build for 32bit machine
5
6Fixed build error on 32bit machine:
7
8../git/src/mmap_hook.cc:309:31: error: static assertion failed
9 309 | static_assert(sizeof(int32_t) == sizeof(off_t), "");
10
11This is because oe's off_t is 64bit on both 32 and 64bit system, which is the
12default value of glibc, so the assertion would be failed on 32bit system, and
13remove mmap() and mmap64() to fix the redefined error.
14
15Upstream-Status: Inappropriate [OE-Specific]
16
17Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
18---
19 src/mmap_hook.cc | 22 ----------------------
20 1 file changed, 22 deletions(-)
21
22diff --git a/src/mmap_hook.cc b/src/mmap_hook.cc
23index 0a0f62f..27425e4 100644
24--- a/src/mmap_hook.cc
25+++ b/src/mmap_hook.cc
26@@ -302,30 +302,8 @@ void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t off) _
27
28 #define HOOKED_MMAP
29
30-#elif defined(DEFINED_DO_MMAP) && defined(__linux__) && !GOOD_LINUX_SYSTEM
31-// Linuxes with 32-bit off_t. We're being careful with mmap64 being
32-// 64-bit and mmap being 32-bit.
33-
34-static_assert(sizeof(int32_t) == sizeof(off_t), "");
35-
36-extern "C" void* mmap64(void* start, size_t length, int prot, int flags, int fd, int64_t off)
37- __THROW ATTRIBUTE_SECTION(malloc_hook);
38-extern "C" void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t off)
39- __THROW ATTRIBUTE_SECTION(malloc_hook);
40-
41-void* mmap(void *start, size_t length, int prot, int flags, int fd, off_t off) __THROW {
42- return do_mmap_with_hooks(start, length, prot, flags, fd, off);
43-}
44-
45-void* mmap64(void *start, size_t length, int prot, int flags, int fd, int64_t off) __THROW {
46- return do_mmap_with_hooks(start, length, prot, flags, fd, off);
47-}
48-
49-#define HOOKED_MMAP
50-
51 #endif // Linux/32-bit off_t case
52
53-
54 #ifdef HOOKED_MMAP
55
56 extern "C" int munmap(void* start, size_t length) __THROW ATTRIBUTE_SECTION(malloc_hook);
57--
582.35.5
59
diff --git a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
index 3034e2017..800fa3a84 100644
--- a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
+++ b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
@@ -6,49 +6,27 @@ Subject: [PATCH] Compatibility fixes for musl.
6--- 6---
7Upstream-Status: Pending 7Upstream-Status: Pending
8 8
9 m4/pc_from_ucontext.m4 | 4 +++- 9 src/getpc.h | 4 ++++
10 src/getpc.h | 3 +++
11 src/stacktrace_powerpc-linux-inl.h | 8 ++++++-- 10 src/stacktrace_powerpc-linux-inl.h | 8 ++++++--
12 3 files changed, 12 insertions(+), 3 deletions(-) 11 2 files changed, 10 insertions(+), 2 deletions(-)
13 12
14diff --git a/m4/pc_from_ucontext.m4 b/m4/pc_from_ucontext.m4
15index 7f09dd7..5f4ee8c 100644
16--- a/m4/pc_from_ucontext.m4
17+++ b/m4/pc_from_ucontext.m4
18@@ -34,6 +34,7 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
19 pc_fields="$pc_fields uc_mcontext.gregs[[R15]]" # Linux (arm old [untested])
20 pc_fields="$pc_fields uc_mcontext.arm_pc" # Linux (arm arch 5)
21 pc_fields="$pc_fields uc_mcontext.gp_regs[[PT_NIP]]" # Suse SLES 11 (ppc64)
22+ pc_fields="$pc_fields uc_mcontext.gregs[[PT_NIP]]"
23 pc_fields="$pc_fields uc_mcontext.mc_eip" # FreeBSD (i386)
24 pc_fields="$pc_fields uc_mcontext.mc_srr0" # FreeBSD (powerpc, powerpc64)
25 pc_fields="$pc_fields uc_mcontext.mc_rip" # FreeBSD (x86_64 [untested])
26@@ -77,7 +78,8 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT],
27 pc_field_found=true)
28 elif test "x$ac_cv_header_ucontext_h" = xyes; then
29 AC_TRY_COMPILE([#define _GNU_SOURCE 1
30- #include <ucontext.h>],
31+ #include <ucontext.h>
32+ #include <asm/ptrace.h>],
33 [ucontext_t u; return u.$pc_field == 0;],
34 AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field,
35 How to access the PC from a struct ucontext)
36diff --git a/src/getpc.h b/src/getpc.h 13diff --git a/src/getpc.h b/src/getpc.h
37index 9605363..cd8ccfa 100644 14index 87d18b6..c569731 100644
38--- a/src/getpc.h 15--- a/src/getpc.h
39+++ b/src/getpc.h 16+++ b/src/getpc.h
40@@ -68,6 +68,9 @@ 17@@ -68,6 +68,10 @@
41 typedef ucontext ucontext_t; 18 typedef ucontext ucontext_t;
42 #endif 19 #endif
43 20
44+#if defined(__powerpc__) && !defined(PT_NIP) 21+#if defined(__powerpc__) && !defined(PT_NIP)
45+#define PT_NIP 32 22+#define PT_NIP 32
46+#endif 23+#endif
24+
25 namespace tcmalloc {
26 namespace getpc {
47 27
48 // Take the example where function Foo() calls function Bar(). For
49 // many architectures, Bar() is responsible for setting up and tearing
50diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h 28diff --git a/src/stacktrace_powerpc-linux-inl.h b/src/stacktrace_powerpc-linux-inl.h
51index a301a46..efca426 100644 29index 883e7d2..212bd25 100644
52--- a/src/stacktrace_powerpc-linux-inl.h 30--- a/src/stacktrace_powerpc-linux-inl.h
53+++ b/src/stacktrace_powerpc-linux-inl.h 31+++ b/src/stacktrace_powerpc-linux-inl.h
54@@ -186,7 +186,7 @@ static int GET_STACK_TRACE_OR_FRAMES { 32@@ -186,7 +186,7 @@ static int GET_STACK_TRACE_OR_FRAMES {
diff --git a/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch b/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch
deleted file mode 100644
index b01cba39c..000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/sgidef.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1From 259b420444c52463795b4b582a2ab7511149eea7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Oct 2017 21:26:40 -0700
4Subject: [PATCH] sgidef.h does not exist on musl and its not needed to compile
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8
9---
10 src/base/linux_syscall_support.h | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13--- a/src/base/linux_syscall_support.h
14+++ b/src/base/linux_syscall_support.h
15@@ -164,7 +164,7 @@ extern "C" {
16 #include <endian.h>
17 #include <fcntl.h>
18
19-#ifdef __mips__
20+#if defined(__mips__) && defined(__glibc__)
21 /* Include definitions of the ABI currently in use. */
22 #include <sgidefs.h>
23 #endif
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.10.bb b/meta-oe/recipes-support/gperftools/gperftools_2.15.bb
index 8db0cecbf..bd3b2afae 100644
--- a/meta-oe/recipes-support/gperftools/gperftools_2.10.bb
+++ b/meta-oe/recipes-support/gperftools/gperftools_2.15.bb
@@ -10,13 +10,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
10 10
11DEPENDS:append:libc-musl = " libucontext" 11DEPENDS:append:libc-musl = " libucontext"
12 12
13SRCREV = "bf8b714bf5075d0a6f2f28504b43095e2b1e11c5" 13SRCREV = "365060c4213a48adb27f63d5dfad41b3dfbdd62e"
14SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https \ 14SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https \
15 file://0001-Support-Atomic-ops-on-clang.patch \
16 file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \ 15 file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
17 file://disable_libunwind_aarch64.patch \ 16 file://disable_libunwind_aarch64.patch \
18 file://sgidef.patch \ 17 file://0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch \
19 file://0001-Define-off64_t-as-off_t-on-musl.patch \
20 " 18 "
21 19
22SRC_URI:append:libc-musl = " file://ppc-musl.patch" 20SRC_URI:append:libc-musl = " file://ppc-musl.patch"