commit:     7b31090aa1016ba80895f7afea6602205a63bcdd
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 21 03:09:43 2020 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Aug 21 03:11:28 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b31090a

dev-util/google-perftools: bump to 2.8

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-util/google-perftools/Manifest                 |  1 +
 .../google-perftools/files/2.8-musl-tests.patch    | 28 +++++++
 .../google-perftools/google-perftools-2.8.ebuild   | 94 ++++++++++++++++++++++
 dev-util/google-perftools/metadata.xml             |  5 ++
 4 files changed, 128 insertions(+)

diff --git a/dev-util/google-perftools/Manifest 
b/dev-util/google-perftools/Manifest
index 437fdfa7e4b..766db525c2a 100644
--- a/dev-util/google-perftools/Manifest
+++ b/dev-util/google-perftools/Manifest
@@ -1,2 +1,3 @@
 DIST gperftools-2.6.2.tar.gz 911811 BLAKE2B 
1201185f3008f75b9db219e47658f5b34294f15d5cae5a9badbc2718d63e58c07e485e84f6af05bdd12398c7ab8af520db9f34f4b33b790b0276ba10fb945358
 SHA512 
2630687d98cdb7011b9b90ba65e337d74f7e1f7d44190edf5414d0898b906686e547e4bb08979f26fb16ca1ccc065a5a1022dee03539bb1ccdf136439eb99ec1
 DIST gperftools-2.7.tar.gz 916854 BLAKE2B 
d14c2b88f2986d3691d7184e1759de2066ca50224f745a6291ab2ebd5f7f985dec4916a1c01d61142eca9b64f3742c50b82e64118602afaa7b27ae2d94a4ed4d
 SHA512 
4a8e72b960218b0615281b830b3f1a4a1b27830006c45ed68b1ffd152bb50a8b3beec850526e330e2ad08c28774bdc01dade9bcc3e7c9e26d30823cc55648d77
+DIST gperftools-2.8.tar.gz 928379 BLAKE2B 
e94bac4153cb5d3170d6486a9065b56d631ab261d25b4a5a150f04f87f767c203508839daf400dbe06dc82e9e3da2988e4b4c74725c6be836fa9c70ed0576209
 SHA512 
c959ffa2b36ecfea10927b40b6dd668385cff7eab3c4bc2d7c5aed5f4de87ce8e4f9b30ab44652a0288badbb6c5aa7110c491b13c4030fb656609c2eb25918a8

diff --git a/dev-util/google-perftools/files/2.8-musl-tests.patch 
b/dev-util/google-perftools/files/2.8-musl-tests.patch
new file mode 100644
index 00000000000..660099a6a88
--- /dev/null
+++ b/dev-util/google-perftools/files/2.8-musl-tests.patch
@@ -0,0 +1,28 @@
+From 1d9b8bb59d5610f2c3e9faad6bbd91ceca17fb93 Mon Sep 17 00:00:00 2001
+From: Aliaksey Kandratsenka <alkondrate...@gmail.com>
+Date: Sat, 11 Jul 2020 20:33:40 -0700
+Subject: [PATCH] don't test sbrk hook if we're on linux and don't have __sbrk
+
+"mmap" hooks code for linux only hooks sbrk when __sbrk is
+defined. But musl doesn't offer this function (reasonably so), so
+sbrk hooking doesn't work there. Not big loss, but lets make sure
+tests don't fail.
+
+Lets reference this to issue #1198
+---
+ src/tests/tcmalloc_unittest.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc
+index d06c5a86..9d303433 100644
+--- a/src/tests/tcmalloc_unittest.cc
++++ b/src/tests/tcmalloc_unittest.cc
+@@ -1503,7 +1503,7 @@ static int RunAllTests(int argc, char** argv) {
+ 
+     // Test sbrk
+     SetSbrkHook();
+-#if defined(HAVE_SBRK) && defined(__linux) && \
++#if defined(HAVE___SBRK) && defined(__linux) && \
+        (defined(__i386__) || defined(__x86_64__))
+     p1 = sbrk(8192);
+     CHECK(p1 != NULL);

diff --git a/dev-util/google-perftools/google-perftools-2.8.ebuild 
b/dev-util/google-perftools/google-perftools-2.8.ebuild
new file mode 100644
index 00000000000..b5cb254c797
--- /dev/null
+++ b/dev-util/google-perftools/google-perftools-2.8.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+MY_P="gperftools-${PV}"
+
+inherit toolchain-funcs flag-o-matic autotools vcs-snapshot multilib-minimal
+
+DESCRIPTION="Fast, multi-threaded malloc() and nifty performance analysis 
tools"
+HOMEPAGE="https://github.com/gperftools/gperftools";
+SRC_URI="https://github.com/gperftools/gperftools/archive/${MY_P}.tar.gz";
+
+LICENSE="MIT"
+SLOT="0/4"
+# contains ASM code, with support for
+# freebsd x86/amd64
+# linux x86/amd64/ppc/ppc64/arm
+# OSX ppc/amd64
+# AIX ppc/ppc64
+KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="largepages largepages64k +debug minimal optimisememory test static-libs"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="!ppc64? ( sys-libs/libunwind )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+       "${FILESDIR}/${PV}-musl-tests.patch"
+)
+
+pkg_setup() {
+       # set up the make options in here so that we can actually make use
+       # of them on both compile and install.
+
+       # Avoid building the unit testing if we're not going to execute
+       # tests; this trick here allows us to ignore the tests without
+       # touching the build system (and thus without rebuilding
+       # autotools). Keep commented as long as it's restricted.
+       use test || \
+               MAKEOPTS+=" noinst_PROGRAMS= "
+}
+
+src_prepare() {
+       default
+       eautoreconf
+       multilib_copy_sources
+}
+
+multilib_src_configure() {
+       use largepages && append-cppflags -DTCMALLOC_LARGE_PAGES
+       use largepages64k && append-cppflags -DTCMALLOC_LARGE_PAGES64K
+       use optimisememory && append-cppflags -DTCMALLOC_SMALL_BUT_SLOW
+       append-flags -fno-strict-aliasing -fno-omit-frame-pointer
+
+       econf \
+               --enable-shared \
+               $(use_enable static-libs static) \
+               $(use_enable debug debugalloc) \
+               $(if [[ ${ABI} == x32 ]]; then printf "--enable-minimal\n" else 
use_enable minimal; fi)
+}
+
+src_test() {
+       case "${LD_PRELOAD}" in
+               *libsandbox*)
+                       ewarn "Unable to run tests when sandbox is enabled."
+                       ewarn "See https://bugs.gentoo.org/290249";
+                       return 0
+                       ;;
+       esac
+
+       multilib-minimal_src_test
+}
+
+src_install() {
+       if ! use minimal && has x32 ${MULTILIB_ABIS}; then
+               MULTILIB_WRAPPED_HEADERS=(
+                       /usr/include/gperftools/heap-checker.h
+                       /usr/include/gperftools/heap-profiler.h
+                       /usr/include/gperftools/stacktrace.h
+                       /usr/include/gperftools/profiler.h
+               )
+       fi
+
+       multilib-minimal_src_install
+}
+
+multilib_src_install_all() {
+       einstalldocs
+       use static-libs || find "${D}" -name '*.la' -delete || die
+}

diff --git a/dev-util/google-perftools/metadata.xml 
b/dev-util/google-perftools/metadata.xml
index 64f38d90459..b29352921cb 100644
--- a/dev-util/google-perftools/metadata.xml
+++ b/dev-util/google-perftools/metadata.xml
@@ -11,6 +11,11 @@
                        memory usage, but should speed up the allocation/free
                        operations.
                </flag>
+               <flag name="largepages64k">
+                       Use (experimental) 64K pages for tcmalloc, this 
increases
+                       memory usage, but should speed up the allocation/free
+                       operations.
+               </flag>
                <flag name="debug">
                        Build a set of libraries with debug support (so-called
                        debugalloc). These are available by default but are not 
needed

Reply via email to