pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/gperftools Use /proc/../maps to get shared libra...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/98f8e8b8ba7b
branches:  trunk
changeset: 418582:98f8e8b8ba7b
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Thu Nov 28 12:19:58 2019 +0000

description:
Use /proc/../maps to get shared library information on NetBSD.
use sysctl kern.proc to get the executable's name on NetBSD.
Add  --enable-stacktrace-via-backtrace to configure
tested on x86_64 and earmv7hf; stacktrace doesn't work on earmv7hf (this
seems to be a problem in our _Unwind_Backtrace implementation).
Bump PKGREVISION

diffstat:

 devel/gperftools/Makefile                          |   5 +-
 devel/gperftools/distinfo                          |   5 +-
 devel/gperftools/patches/patch-src_base_sysinfo.cc |  65 ++++++++++++++++++++++
 devel/gperftools/patches/patch-src_symbolize.cc    |  24 ++++++++
 4 files changed, 96 insertions(+), 3 deletions(-)

diffs (134 lines):

diff -r 74570b18fdaf -r 98f8e8b8ba7b devel/gperftools/Makefile
--- a/devel/gperftools/Makefile Thu Nov 28 12:09:58 2019 +0000
+++ b/devel/gperftools/Makefile Thu Nov 28 12:19:58 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.15 2019/11/03 10:39:13 rillig Exp $
+# $NetBSD: Makefile,v 1.16 2019/11/28 12:19:58 bouyer Exp $
 
 DISTNAME=      gperftools-2.7
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=gperftools/}
 GITHUB_PROJECT=        gperftools
@@ -25,6 +25,7 @@
 .include "../../mk/bsd.prefs.mk"
 .if (${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD") && exists(/usr/include/execinfo.h)
 LIBS+=                 -lexecinfo
+CONFIGURE_ARGS+=       --enable-stacktrace-via-backtrace
 .endif
 
 PKGCONFIG_OVERRIDE=            libprofiler.pc
diff -r 74570b18fdaf -r 98f8e8b8ba7b devel/gperftools/distinfo
--- a/devel/gperftools/distinfo Thu Nov 28 12:09:58 2019 +0000
+++ b/devel/gperftools/distinfo Thu Nov 28 12:19:58 2019 +0000
@@ -1,8 +1,11 @@
-$NetBSD: distinfo,v 1.10 2018/05/10 07:28:46 adam Exp $
+$NetBSD: distinfo,v 1.11 2019/11/28 12:19:58 bouyer Exp $
 
 SHA1 (gperftools-2.7.tar.gz) = 89e3e1df674bc4ba1a9e97246b58a26a4e92d0a3
 RMD160 (gperftools-2.7.tar.gz) = a45ba1a6e601fe46ec7b7ed3035251f991371bd2
 SHA512 (gperftools-2.7.tar.gz) = 7cd079fcfa9fd517ef99ff81c294daa6150898ae9024cb5ee02e1bce086d135d2cadcd2b863528cc82327fc00c9f4574d5078b47a02ac57fbc393fa66adc32ec
 Size (gperftools-2.7.tar.gz) = 1523562 bytes
+SHA1 (patch-benchmark_getcontext_light.cc) = 892c709fbda8476053e581262feeea4af1a27795
 SHA1 (patch-configure) = 612e1dda5ecf65451153e9616f69e0c58add086a
 SHA1 (patch-src_base_atomicops-internals-arm-v6plus.h) = b3aeddd10d2506192551485570c31c0b3ff02432
+SHA1 (patch-src_base_sysinfo.cc) = 558034b05ad3d2870a7269762d3b58442824e649
+SHA1 (patch-src_symbolize.cc) = fdbc603dba286b45d092c3447b80a537549bd78d
diff -r 74570b18fdaf -r 98f8e8b8ba7b devel/gperftools/patches/patch-src_base_sysinfo.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/gperftools/patches/patch-src_base_sysinfo.cc        Thu Nov 28 12:19:58 2019 +0000
@@ -0,0 +1,65 @@
+$NetBSD: patch-src_base_sysinfo.cc,v 1.1 2019/11/28 12:19:58 bouyer Exp $
+
+Get mappings from procfs on NetBSD
+
+--- src/base/sysinfo.cc.orig   2017-11-28 15:38:09.000000000 +0100
++++ src/base/sysinfo.cc        2019-11-27 19:01:54.000000000 +0100
+@@ -47,7 +47,7 @@
+ #include <mach-o/loader.h>    // for iterating over dll's in ProcMapsIter
+ #include <sys/types.h>
+ #include <sys/sysctl.h>       // how we figure out numcpu's on OS X
+-#elif defined __FreeBSD__
++#elif defined __FreeBSD__ || defined __NetBSD__
+ #include <sys/sysctl.h>
+ #elif defined __sun__         // Solaris
+ #include <procfs.h>           // for, e.g., prmap_t
+@@ -273,7 +273,7 @@
+ 
+ // ----------------------------------------------------------------------
+ 
+-#if defined __linux__ || defined __FreeBSD__ || defined __sun__ || defined __CYGWIN__ || defined __CYGWIN32__
++#if defined __linux__ || defined __FreeBSD__ || defined __sun__ || defined __CYGWIN__ || defined __CYGWIN32__ || defined __NetBSD__
+ static void ConstructFilename(const char* spec, pid_t pid,
+                               char* buf, int buf_size) {
+   CHECK_LT(snprintf(buf, buf_size,
+@@ -425,7 +425,7 @@
+                               char *flags, uint64 *offset,
+                               int *major, int *minor, int64 *inode,
+                               unsigned *filename_offset) {
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__NetBSD__)
+   /*
+    * It's similar to:
+    * sscanf(text, "%"SCNx64"-%"SCNx64" %4s %"SCNx64" %x:%x %"SCNd64" %n",
+@@ -518,6 +518,13 @@
+     ConstructFilename("/proc/%d/map", pid, ibuf_, Buffer::kBufSize);
+   }
+   NO_INTR(fd_ = open(ibuf_, O_RDONLY));
++#elif defined(__NetBSD__)
++  if (pid == 0) {
++    ConstructFilename("/proc/curproc/maps", 1, ibuf_, Buffer::kBufSize);
++  } else {
++    ConstructFilename("/proc/%d/maps", pid, ibuf_, Buffer::kBufSize);
++  }
++  NO_INTR(fd_ = open(ibuf_, O_RDONLY));
+ #elif defined(__sun__)
+   if (pid == 0) {
+     ConstructFilename("/proc/self/map", 1, ibuf_, Buffer::kBufSize);
+@@ -575,7 +582,7 @@
+                                uint64 *anon_mapping, uint64 *anon_pages,
+                                dev_t *dev) {
+ 
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__CYGWIN32__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__CYGWIN32__) || defined __NetBSD__
+   do {
+     // Advance to the start of the next line
+     stext_ = nextline_;
+@@ -615,7 +622,7 @@
+     int64 tmpinode;
+     int major, minor;
+     unsigned filename_offset = 0;
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__NetBSD__)
+     // for now, assume all linuxes have the same format
+     if (!ParseProcMapsLine(
+         stext_,
diff -r 74570b18fdaf -r 98f8e8b8ba7b devel/gperftools/patches/patch-src_symbolize.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/gperftools/patches/patch-src_symbolize.cc   Thu Nov 28 12:19:58 2019 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_symbolize.cc,v 1.1 2019/11/28 12:19:58 bouyer Exp $
+
+Get program pathname from sysctl on NetBSD
+
+--- src/symbolize.cc.orig      2017-12-09 17:29:18.000000000 +0100
++++ src/symbolize.cc   2019-11-27 18:40:56.000000000 +0100
+@@ -60,7 +60,7 @@
+ #include "base/commandlineflags.h"
+ #include "base/logging.h"
+ #include "base/sysinfo.h"
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <sys/sysctl.h>
+ #endif
+ 
+@@ -97,7 +97,7 @@
+       return NULL;
+   }
+   return program_invocation_name;
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+   static char program_invocation_name[PATH_MAX];
+   size_t len = sizeof(program_invocation_name);
+   static const int name[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };



Home | Main Index | Thread Index | Old Index