summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch26
-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/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch35
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch32
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch28
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch14
-rw-r--r--meta-oe/recipes-support/gperftools/gperftools_2.16.bb (renamed from meta-oe/recipes-support/gperftools/gperftools_2.15.bb)14
7 files changed, 83 insertions, 125 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
deleted file mode 100644
index 2ea54e48c9..0000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1From 06605158852f9364519391fa11070ba5ec4303e9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 08:07:17 -0700
4Subject: [PATCH] disbale heap checkers and debug allocator on musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Upstream-Status: Pending
9
10---
11 configure.ac | 2 ++
12 1 file changed, 2 insertions(+)
13
14diff --git a/configure.ac b/configure.ac
15index 68fd51c..4cb71fe 100644
16--- a/configure.ac
17+++ b/configure.ac
18@@ -53,6 +53,8 @@ case "$host" in
19 need_nanosleep=no;;
20 *-cygwin*) default_enable_cpu_profiler=no;;
21 *-linux*) default_enable_heap_checker=yes; heap_checker_supported=yes;;
22+ *-musl*) default_enable_heap_checker=no; default_enable_heap_profiler=no;
23+ default_enable_debugalloc=no; default_enable_libunwind=no;
24 esac
25
26 # Currently only backtrace works on s390 and OSX.
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
deleted file mode 100644
index 1142df0be9..0000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch
+++ /dev/null
@@ -1,59 +0,0 @@
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/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
new file mode 100644
index 0000000000..eae71be8fc
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch
@@ -0,0 +1,35 @@
1From 02ff9fcc74ba64aeb22fcc553f30657bd2b62930 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 26 Feb 2025 23:46:56 -0800
4Subject: [PATCH 2/3] src/base/elf_mem_image.cc: fix build for musl
5
6Include header file for musl to avoid error below:
7
8 error: '__WORDSIZE' was not declared in this scope
9
10Upstream-Status: Pending
11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 src/base/elf_mem_image.cc | 5 +++++
15 1 file changed, 5 insertions(+)
16
17diff --git a/src/base/elf_mem_image.cc b/src/base/elf_mem_image.cc
18index d2ca1a5..89dc0e4 100644
19--- a/src/base/elf_mem_image.cc
20+++ b/src/base/elf_mem_image.cc
21@@ -38,6 +38,11 @@
22
23 #ifdef HAVE_ELF_MEM_IMAGE // defined in elf_mem_image.h
24
25+// for musl __WORDSIZE definition
26+#if !defined(__GLIBC__)
27+#include <sys/reg.h>
28+#endif
29+
30 #include <stddef.h> // for size_t, ptrdiff_t
31 #include "base/logging.h"
32
33--
342.25.1
35
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
new file mode 100644
index 0000000000..01ecdd5336
--- /dev/null
+++ b/meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch
@@ -0,0 +1,32 @@
1From 3bb5707c6a6a0d2061c79c556cbe4a87efea02ab Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 27 Feb 2025 00:44:34 -0800
4Subject: [PATCH 3/3] Makefile.am: disable building noinst tests for musl
5
6Build fails for musl + qemuppc64 about ld failing to find
7symbols in libucontext. Until a real solution is found,
8we need this workaround.
9
10Upstream-Status: Inappropriate [OE Specific]
11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 Makefile.am | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/Makefile.am b/Makefile.am
18index 9fa24c0..7dd1b60 100644
19--- a/Makefile.am
20+++ b/Makefile.am
21@@ -938,7 +938,7 @@ endif WITH_HEAP_PROFILER_OR_CHECKER
22 # This should always include $(TESTS), but may also include other
23 # binaries that you compile but don't want automatically installed.
24 # We'll add to this later, on a library-by-library basis
25-noinst_PROGRAMS += $(TESTS)
26+#noinst_PROGRAMS += $(TESTS)
27
28 # http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki
29 pkgconfigdir = $(libdir)/pkgconfig
30--
312.25.1
32
diff --git a/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch b/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
deleted file mode 100644
index 15eacc8993..0000000000
--- a/meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 564f800e3e24647c095f7a321bf3ebdccfbf762d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Sep 2017 12:02:04 -0700
4Subject: [PATCH] Disable libunwind on aarch64
5
6Fixes hangs when using libtcmalloc.so
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11---
12 configure.ac | 5 +++++
13 1 file changed, 5 insertions(+)
14
15--- a/configure.ac
16+++ b/configure.ac
17@@ -76,6 +76,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [re
18 [default_enable_libunwind=yes
19 default_tcmalloc_pagesize=8])
20
21+# Disable libunwind linking on aarch64 by default.
22+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __aarch64__])],
23+ [default_enable_libunwind=no],
24+ [default_enable_libunwind=yes])
25+
26 AC_ARG_ENABLE([cpu-profiler],
27 [AS_HELP_STRING([--disable-cpu-profiler],
28 [do not build the cpu profiler])],
diff --git a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
index 800fa3a84f..e5061840bc 100644
--- a/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
+++ b/meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch
@@ -1,20 +1,21 @@
1From 328805fd16930deefda400a77e9c2c5d17d04d29 Mon Sep 17 00:00:00 2001 1From 1526be49b8c49719459ef15c93090fdbdc10f3cb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 13 Mar 2021 00:42:25 -0800 3Date: Sat, 13 Mar 2021 00:42:25 -0800
4Subject: [PATCH] Compatibility fixes for musl. 4Subject: [PATCH 1/3] Compatibility fixes for musl.
5 5
6---
7Upstream-Status: Pending 6Upstream-Status: Pending
8 7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
9 src/getpc.h | 4 ++++ 10 src/getpc.h | 4 ++++
10 src/stacktrace_powerpc-linux-inl.h | 8 ++++++-- 11 src/stacktrace_powerpc-linux-inl.h | 8 ++++++--
11 2 files changed, 10 insertions(+), 2 deletions(-) 12 2 files changed, 10 insertions(+), 2 deletions(-)
12 13
13diff --git a/src/getpc.h b/src/getpc.h 14diff --git a/src/getpc.h b/src/getpc.h
14index 87d18b6..c569731 100644 15index c14c9d0..cf4866b 100644
15--- a/src/getpc.h 16--- a/src/getpc.h
16+++ b/src/getpc.h 17+++ b/src/getpc.h
17@@ -68,6 +68,10 @@ 18@@ -61,6 +61,10 @@
18 typedef ucontext ucontext_t; 19 typedef ucontext ucontext_t;
19 #endif 20 #endif
20 21
@@ -59,3 +60,6 @@ index 883e7d2..212bd25 100644
59 } 60 }
60 #endif 61 #endif
61 62
63--
642.25.1
65
diff --git a/meta-oe/recipes-support/gperftools/gperftools_2.15.bb b/meta-oe/recipes-support/gperftools/gperftools_2.16.bb
index bd3b2afaea..2b0fb534b3 100644
--- a/meta-oe/recipes-support/gperftools/gperftools_2.15.bb
+++ b/meta-oe/recipes-support/gperftools/gperftools_2.16.bb
@@ -10,14 +10,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
10 10
11DEPENDS:append:libc-musl = " libucontext" 11DEPENDS:append:libc-musl = " libucontext"
12 12
13SRCREV = "365060c4213a48adb27f63d5dfad41b3dfbdd62e" 13SRCREV = "e1014dead2029b341d06027b4f2b5562d799d5b1"
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-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
16 file://disable_libunwind_aarch64.patch \
17 file://0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch \
18 "
19 15
20SRC_URI:append:libc-musl = " file://ppc-musl.patch" 16SRC_URI:append:libc-musl = " \
17 file://ppc-musl.patch \
18 file://0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch \
19 file://0003-Makefile.am-disable-building-noinst-tests-for-musl.patch \
20 "
21 21
22inherit autotools 22inherit autotools
23 23