Skip to contentSkip to conversation

gperftools: upgrade from 2.15 to 2.16

PATCH New [email protected] 1 participant 1 message Feb 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gperftools: upgrade from 2.15 to 2.16

From: Chen Qi <[email protected]>

disable_libunwind_aarch64.patch is dropped because from my runtime testing, this patch is no longer needed.

0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch is dropped because I don't see it necessary now. Things still build without it.

0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch is dropped because this oe specific patch is no longer needed because of the following two commits:
02adc8c also disable _TIME_BITS in mmap_hook.cc
198b3dd disable _FILE_OFFSET_BITS in mmap_hook.cc

ppc-musl.patch is rebased.

0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch is added to fix build failure for musl + ppc64.

0003-Makefile.am-disable-building-noinst-tests-for-musl.patch is added as a workaround to fix build failure on musl + ppc64.

---
 ...checkers-and-debug-allocator-on-musl.patch | 26 --------
 ..._hook.cc-Fix-build-for-32bit-machine.patch | 59 -------------------
 ...-elf_mem_image.cc-fix-build-for-musl.patch | 35 +++++++++++
 ...sable-building-noinst-tests-for-musl.patch | 32 ++++++++++
 .../disable_libunwind_aarch64.patch           | 28 ---------
 .../gperftools/gperftools/ppc-musl.patch      | 14 +++--
 ...{gperftools_2.15.bb => gperftools_2.16.bb} | 14 ++---
 7 files changed, 83 insertions(+), 125 deletions(-)
 delete mode 100644 meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch
 delete mode 100644 meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch
 create mode 100644 meta-oe/recipes-support/gperftools/gperftools/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch
 create mode 100644 meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch
 delete mode 100644 meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch
 rename meta-oe/recipes-support/gperftools/{gperftools_2.15.bb => gperftools_2.16.bb} (86%)
meta-oe/recipes-support/gperftools/gperftools/0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch deleted +0 -26
deleted file mode 100644
index 2ea54e48c9..0000000000
@@ -1,26 +0,0 @@
-From 06605158852f9364519391fa11070ba5ec4303e9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 2 Sep 2017 08:07:17 -0700
-Subject: [PATCH] disbale heap checkers and debug allocator on musl
-
-Signed-off-by: Khem Raj <[email protected]>
-
-Upstream-Status: Pending
-
----
- configure.ac | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 68fd51c..4cb71fe 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -53,6 +53,8 @@ case "$host" in
-              need_nanosleep=no;;
-    *-cygwin*) default_enable_cpu_profiler=no;;
-    *-linux*) default_enable_heap_checker=yes; heap_checker_supported=yes;;
-+   *-musl*) default_enable_heap_checker=no; default_enable_heap_profiler=no;
-+            default_enable_debugalloc=no; default_enable_libunwind=no;
- esac
- 
- # Currently only backtrace works on s390 and OSX.
meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch deleted +0 -59

59 lines not on this page · raw message

meta-oe/recipes-support/gperftools/gperftools/0002-src-base-elf_mem_image.cc-fix-build-for-musl.patch new file +35 -0
new file mode 100644
index 0000000000..eae71be8fc
@@ -0,0 +1,35 @@
+From 02ff9fcc74ba64aeb22fcc553f30657bd2b62930 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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 <sys/reg.h>
++#endif
++
+ #include <stddef.h>   // for size_t, ptrdiff_t
+ #include "base/logging.h"
+ 
+-- 
+2.25.1
+
meta-oe/recipes-support/gperftools/gperftools/0003-Makefile.am-disable-building-noinst-tests-for-musl.patch new file +32 -0
new file mode 100644
index 0000000000..01ecdd5336
@@ -0,0 +1,32 @@
+From 3bb5707c6a6a0d2061c79c556cbe4a87efea02ab Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-oe/recipes-support/gperftools/gperftools/disable_libunwind_aarch64.patch deleted +0 -28
deleted file mode 100644
index 15eacc8993..0000000000
@@ -1,28 +0,0 @@
-From 564f800e3e24647c095f7a321bf3ebdccfbf762d Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 2 Sep 2017 12:02:04 -0700
-Subject: [PATCH] Disable libunwind on aarch64
-
-Fixes hangs when using libtcmalloc.so
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
----
- configure.ac | 5 +++++
- 1 file changed, 5 insertions(+)
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -76,6 +76,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [re
-                   [default_enable_libunwind=yes
-                    default_tcmalloc_pagesize=8])
- 
-+# Disable libunwind linking on aarch64 by default.
-+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __aarch64__])],
-+                  [default_enable_libunwind=no],
-+                  [default_enable_libunwind=yes])
-+
- AC_ARG_ENABLE([cpu-profiler],
-               [AS_HELP_STRING([--disable-cpu-profiler],
-                               [do not build the cpu profiler])],
meta-oe/recipes-support/gperftools/gperftools/ppc-musl.patch +9 -5
index 800fa3a84f..e5061840bc 100644
@@ -1,20 +1,21 @@
-From 328805fd16930deefda400a77e9c2c5d17d04d29 Mon Sep 17 00:00:00 2001
+From 1526be49b8c49719459ef15c93090fdbdc10f3cb Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Sat, 13 Mar 2021 00:42:25 -0800
-Subject: [PATCH] Compatibility fixes for musl.
+Subject: [PATCH 1/3] Compatibility fixes for musl.
 
----
 Upstream-Status: Pending
 
+Signed-off-by: Chen Qi <[email protected]>
+---
  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 87d18b6..c569731 100644
+index c14c9d0..cf4866b 100644
 --- a/src/getpc.h
 +++ b/src/getpc.h
-@@ -68,6 +68,10 @@
+@@ -61,6 +61,10 @@
  typedef ucontext ucontext_t;
  #endif
  
@@ -59,3 +60,6 @@ index 883e7d2..212bd25 100644
        }
  #endif
  
+-- 
+2.25.1
+
meta-oe/recipes-support/gperftools/gperftools_2.16.bb renamed from meta-oe/recipes-support/gperftools/gperftools_2.15.bb +7 -7
similarity index 86%
rename from meta-oe/recipes-support/gperftools/gperftools_2.15.bb
rename to meta-oe/recipes-support/gperftools/gperftools_2.16.bb
index bd3b2afaea..2b0fb534b3 100644
@@ -10,14 +10,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
 
 DEPENDS:append:libc-musl = " libucontext"
 
-SRCREV = "365060c4213a48adb27f63d5dfad41b3dfbdd62e"
-SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https \
-           file://0001-disbale-heap-checkers-and-debug-allocator-on-musl.patch \
-           file://disable_libunwind_aarch64.patch \
-           file://0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch \
-           "
+SRCREV = "e1014dead2029b341d06027b4f2b5562d799d5b1"
+SRC_URI = "git://github.com/gperftools/gperftools;branch=master;protocol=https"
 
-SRC_URI:append:libc-musl = " file://ppc-musl.patch"
+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
 
Signature · 1 line
2.25.1