diff options
-rw-r--r-- | dev-util/google-perftools/files/fix_ppc64el_FTBFS.patch | 31 | ||||
-rw-r--r-- | dev-util/google-perftools/google-perftools-2.7-r1.ebuild | 91 |
2 files changed, 122 insertions, 0 deletions
diff --git a/dev-util/google-perftools/files/fix_ppc64el_FTBFS.patch b/dev-util/google-perftools/files/fix_ppc64el_FTBFS.patch new file mode 100644 index 000000000000..84f28e1eefe8 --- /dev/null +++ b/dev-util/google-perftools/files/fix_ppc64el_FTBFS.patch @@ -0,0 +1,31 @@ +Description: ucontext constants in ptrace.h on ppc64el + Needs to include the mentioned header for ucontext. +Author: Laszlo Boszormenyi (GCS) <gcs@debian.org> +Bug-Debian: https://bugs.debian.org/894749 +Forwarded: no +Last-Update: 2018-05-06 + +--- + +--- google-perftools-2.7.orig/m4/pc_from_ucontext.m4 ++++ google-perftools-2.7/m4/pc_from_ucontext.m4 +@@ -55,7 +55,8 @@ AC_DEFUN([AC_PC_FROM_UCONTEXT], + pc_field_found=true) + elif test "x$ac_cv_header_sys_ucontext_h" = xyes; then + AC_TRY_COMPILE([#define _GNU_SOURCE 1 +- #include <sys/ucontext.h>], ++ #include <sys/ucontext.h>, ++ #include <asm/ptrace.h>], + [ucontext_t u; return u.$pc_field == 0;], + AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field, + How to access the PC from a struct ucontext) +--- google-perftools-2.7.orig/src/getpc.h ++++ google-perftools-2.7/src/getpc.h +@@ -58,6 +58,7 @@ + #include <string.h> // for memcmp + #if defined(HAVE_SYS_UCONTEXT_H) + #include <sys/ucontext.h> ++#include <asm/ptrace.h> + #elif defined(HAVE_UCONTEXT_H) + #include <ucontext.h> // for ucontext_t (and also mcontext_t) + #elif defined(HAVE_CYGWIN_SIGNAL_H) diff --git a/dev-util/google-perftools/google-perftools-2.7-r1.ebuild b/dev-util/google-perftools/google-perftools-2.7-r1.ebuild new file mode 100644 index 000000000000..fb3a1b1d9f3d --- /dev/null +++ b/dev-util/google-perftools/google-perftools-2.7-r1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +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/tarball/${MY_P} -> ${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 +debug minimal optimisememory test static-libs" +RESTRICT="!test? ( test )" + +DEPEND="!ppc64? ( sys-libs/libunwind )" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}"/fix_ppc64el_FTBFS.patch ) + +S="${WORKDIR}/${MY_P}" + +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 optimisememory && append-cppflags -DTCMALLOC_SMALL_BUT_SLOW + append-flags -fno-strict-aliasing -fno-omit-frame-pointer + + econf \ + --docdir=${EPREFIX}/usr/share/doc/${PF} \ + --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 +} |