aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAric Belsito <lluixhi@gmail.com>2017-01-21 12:09:31 -0800
committerAric Belsito <lluixhi@gmail.com>2017-01-21 12:09:31 -0800
commit35f580f53b8245d29dbc6924c863f1b35ba47cf8 (patch)
tree3697118041fdf13a1341926936c117b212c17bb9 /dev-util
parentdev-libs/elfutils: Add stable and unstable (diff)
downloadmusl-35f580f53b8245d29dbc6924c863f1b35ba47cf8.tar.gz
musl-35f580f53b8245d29dbc6924c863f1b35ba47cf8.tar.bz2
musl-35f580f53b8245d29dbc6924c863f1b35ba47cf8.zip
dev-util/systemtap: Add most recent version
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/systemtap/Manifest4
-rw-r--r--dev-util/systemtap/files/systemtap-2.9-musl.patch186
-rw-r--r--dev-util/systemtap/metadata.xml7
-rw-r--r--dev-util/systemtap/systemtap-2.9.ebuild80
4 files changed, 277 insertions, 0 deletions
diff --git a/dev-util/systemtap/Manifest b/dev-util/systemtap/Manifest
new file mode 100644
index 0000000..57c6fb4
--- /dev/null
+++ b/dev-util/systemtap/Manifest
@@ -0,0 +1,4 @@
+AUX systemtap-2.9-musl.patch 6271 SHA256 422497a92cda46722684a24385cd70a5481bc98f512c2eff45b1bd7bf7567138 SHA512 517efd2df46d6a99e07361ccfeece74bb0192194061c824328377f5618c0349a037c888e3cf8dd0738896b127d296aacb7c21fbdca4209301f9ba090d28c97b3 WHIRLPOOL cfea1024590bcefe5c1124ad8dd8c9c379fc18026a30f7962f3bd6e4d64365c5d3ef7b862af0fc849514d24e061702babd47ed326b5b0b094f38a6801d959703
+DIST systemtap-2.9.tar.gz 3258026 SHA256 04f2c607512f4867f345a3d173940e1023441c5d3560f2e580b4a82dfe4d6353 SHA512 00d24ad52d5634b540241a9fc64efbab7fa1d34d31a0254b43474101d3024f050ab7ec284aba0c082889066e1b4cf4c38799801910bff7516ca2e380684089dc WHIRLPOOL fa8d3978f0768091c5cc3bd1cd4b13b6ff9643e2e37ee8e8b59c1801fd7ddcad7029d06e4a1207dc5add5faf423de9ccdb9df677b7db88a5199b1fde731fcb3a
+EBUILD systemtap-2.9.ebuild 2141 SHA256 b6b66f98e01762f427b1934a6db85401665114b5e8ff51931c67d566b6b4f131 SHA512 f7833c45851fd70c774ad0559394dc0e4baad27154ff7aee2ac3c58e7326c5aae98c1c2b14a0c41b37aa2fc3437fae3d3f9dc857795cdc8377cde86bdc88f554 WHIRLPOOL 8d2d5353089f8c2c889587e77d4d418b25d1f1ddd73c616c4e47ef1cb3f52d2d717c498fe018da541f9e46498e58b91c93aca9223dab92439036fd34d320f4c6
+MISC metadata.xml 217 SHA256 9db437db95b71c3fcf9d45c3532ffb53c60b29a58c537dfe6c6d416d13b7cab5 SHA512 c677e2bf2d79d816a1be0e24c81fb40077680049b86f2691d7f88e652c8e3f9583d80f0bfb4c30ed3884160d18e497c6e3430b85d5c00ea92dd4801619e57590 WHIRLPOOL 312f5414c35807bc495126a66930517724a6a45f6b2ba4148fd4205ab41d0e5e8ef05746e373b25f7d1df7649d9b49f06a87f58f0d12d68a671260127b05d7b4
diff --git a/dev-util/systemtap/files/systemtap-2.9-musl.patch b/dev-util/systemtap/files/systemtap-2.9-musl.patch
new file mode 100644
index 0000000..410e782
--- /dev/null
+++ b/dev-util/systemtap/files/systemtap-2.9-musl.patch
@@ -0,0 +1,186 @@
+diff -Naurw systemtap-2.9.orig/buildrun.cxx systemtap-2.9/buildrun.cxx
+--- systemtap-2.9.orig/buildrun.cxx 2016-02-03 17:29:35.158854189 -0800
++++ systemtap-2.9/buildrun.cxx 2016-02-03 17:29:45.349853899 -0800
+@@ -788,13 +788,14 @@
+ if (s.need_uprobes && !kernel_built_uprobes(s))
+ {
+ string opt_u = "-u";
++ char *p = strchr(s.uprobes_path.c_str(), '/');
+ if (!s.uprobes_path.empty() &&
+ strverscmp("1.4", version.c_str()) <= 0)
+ {
+ if (remotedir.empty())
+ opt_u.append(s.uprobes_path);
+ else
+- opt_u.append(remotedir + "/" + basename(s.uprobes_path.c_str()));
++ opt_u.append(remotedir + "/" + (p ? p + 1 : s.uprobes_path.c_str()));
+ }
+ staprun_cmd.push_back(opt_u);
+ }
+diff -Naurw systemtap-2.9.orig/configure.ac systemtap-2.9/configure.ac
+--- systemtap-2.9.orig/configure.ac 2016-02-03 17:29:35.161854189 -0800
++++ systemtap-2.9/configure.ac 2016-02-03 17:45:48.771826500 -0800
+@@ -443,6 +443,50 @@
+ fi
+ fi
+
++dnl Check if we have argp available from our libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <argp.h>],
++ [int argc=1; char *argv[]={"test"}, argp_parse(0,argc,argv,0,0,0); return 0;]
++ )],
++ [libc_has_argp="true"],
++ [libc_has_argp="false"]
++)
++
++dnl If our libc doesn't provide argp, then test for libargp
++if test "$libc_has_argp" = "false" ; then
++ AC_MSG_WARN("libc does not have argp")
++ AC_CHECK_LIB([argp], [argp_parse], [have_obstack="true"], [have_obstack="false"])
++
++ if test "$have_argp" = "false"; then
++ AC_MSG_ERROR("no libargp found")
++ else
++ stap_LIBS="$stap_LIBS -largp"
++ fi
++fi
++
++dnl Check if we have obstack available from our libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <obstack.h>],
++ [_obstack_begin(0, 0, 0, 0, 0); return 0;]
++ )],
++ [libc_has_obstack="true", AC_DEFINE(HAVE_OBSTACK, 1)],
++ [libc_has_obstack="false"]
++)
++
++dnl If our libc doesn't provide obstack, then test for libobstack
++if test "$libc_has_obstack" = "false" ; then
++ AC_MSG_WARN("libc does not have obstack")
++ AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], [have_obstack="false"])
++
++ if test "$have_obstack" = "false"; then
++ AC_MSG_ERROR("no libobstack found")
++ else
++ stap_LIBS="$stap_LIBS -lobstack"
++ fi
++fi
++
+ AC_SUBST(stap_LIBS)
+ AC_MSG_NOTICE([stap will link $stap_LIBS])
+
+diff -Naurw systemtap-2.9.orig/csclient.cxx systemtap-2.9/csclient.cxx
+--- systemtap-2.9.orig/csclient.cxx 2016-02-03 17:29:35.161854189 -0800
++++ systemtap-2.9/csclient.cxx 2016-02-03 17:29:45.353853899 -0800
+@@ -75,6 +75,10 @@
+
+ #define MOK_PUBLIC_CERT_NAME "signing_key.x509"
+
++#ifndef NI_IDN
++#define NI_IDN 32
++#endif
++
+ static PRIPv6Addr &copyAddress (PRIPv6Addr &PRin6, const in6_addr &in6);
+ static PRNetAddr &copyNetAddr (PRNetAddr &x, const PRNetAddr &y);
+ bool operator!= (const PRNetAddr &x, const PRNetAddr &y);
+@@ -1038,7 +1042,7 @@
+
+ // Canonicalize the given path and remove the leading /.
+ string rpath;
+- char *cpath = canonicalize_file_name (path.c_str ());
++ char *cpath = realpath (path.c_str (), NULL);
+ if (! cpath)
+ {
+ // It can not be canonicalized. Use the name relative to
+diff -Naurw systemtap-2.9.orig/loc2c-test.c systemtap-2.9/loc2c-test.c
+--- systemtap-2.9.orig/loc2c-test.c 2016-02-03 17:29:35.222854187 -0800
++++ systemtap-2.9/loc2c-test.c 2016-02-03 17:29:45.354853899 -0800
+@@ -11,7 +11,8 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
++#define error err
+ #if ENABLE_NLS
+ #include <locale.h>
+ #endif
+@@ -519,7 +520,7 @@
+ }
+ else
+ {
+- error (2, 0, "Error, dwarf_entry_breakpoints returned an error( %s )\n",
++ error (2, 0, "Error, dwarf_entry_breakpoints returned an err( %s )\n",
+ dwarf_errmsg (result));
+ }
+ }
+diff -Naurw systemtap-2.9.orig/loc2c.c systemtap-2.9/loc2c.c
+--- systemtap-2.9.orig/loc2c.c 2016-02-03 17:29:35.222854187 -0800
++++ systemtap-2.9/loc2c.c 2016-02-03 17:51:01.664817602 -0800
+@@ -12,7 +12,7 @@
+ #include <obstack.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <dwarf.h>
+ #include <elfutils/libdw.h>
+ #include <elfutils/version.h>
+diff -Naurw systemtap-2.9.orig/remote.cxx systemtap-2.9/remote.cxx
+--- systemtap-2.9.orig/remote.cxx 2016-02-03 17:29:35.239854186 -0800
++++ systemtap-2.9/remote.cxx 2016-02-03 17:29:45.359853899 -0800
+@@ -459,7 +459,8 @@
+
+ if (!s->uprobes_path.empty())
+ {
+- string remoteuprobes = basename(s->uprobes_path.c_str());
++ char *p = strchr(s->uprobes_path.c_str(), '/');
++ string remoteuprobes = p ? p + 1 : s->uprobes_path.c_str();
+ if ((rc = send_file(s->uprobes_path, remoteuprobes)))
+ return rc;
+
+diff -Naurw systemtap-2.9.orig/sdt_types.h systemtap-2.9/sdt_types.h
+--- systemtap-2.9.orig/sdt_types.h 2016-02-03 17:29:35.301854185 -0800
++++ systemtap-2.9/sdt_types.h 2016-02-03 17:29:45.360853899 -0800
+@@ -10,6 +10,13 @@
+ #define UPROBE2_TYPE 0x32425055 /* "UPB2" */
+ #define UPROBE3_TYPE 0x33425055 /* "UPB3" */
+
++#ifndef __uint32_t
++#define __uint32_t uint32_t
++#endif
++#ifndef __uint64_t
++#define __uint64_t uint64_t
++#endif
++
+ typedef enum
+ {
+ uprobe1_type = UPROBE1_TYPE,
+diff -Naurw systemtap-2.9.orig/session.cxx systemtap-2.9/session.cxx
+--- systemtap-2.9.orig/session.cxx 2016-02-03 17:29:35.301854185 -0800
++++ systemtap-2.9/session.cxx 2016-02-03 17:29:45.362853899 -0800
+@@ -1329,7 +1329,7 @@
+ cerr << "ERROR: multiple --sysroot options not supported" << endl;
+ return 1;
+ } else {
+- char *spath = canonicalize_file_name (optarg);
++ char *spath = realpath (optarg, NULL);
+ if (spath == NULL) {
+ cerr << _F("ERROR: %s is an invalid directory for --sysroot", optarg) << endl;
+ return 1;
+diff -Naurw systemtap-2.9.orig/staprun/staprun.h systemtap-2.9/staprun/staprun.h
+--- systemtap-2.9.orig/staprun/staprun.h 2016-02-03 17:29:35.312854184 -0800
++++ systemtap-2.9/staprun/staprun.h 2016-02-03 17:29:45.363853898 -0800
+@@ -48,6 +48,10 @@
+ #endif
+
+
++#ifndef __off_t
++#define __off_t off_t
++#endif
++
+ /* define gettext options if NLS is set */
+ #if ENABLE_NLS
+ #define _(string) gettext(string)
diff --git a/dev-util/systemtap/metadata.xml b/dev-util/systemtap/metadata.xml
new file mode 100644
index 0000000..208c069
--- /dev/null
+++ b/dev-util/systemtap/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>swegener@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-util/systemtap/systemtap-2.9.ebuild b/dev-util/systemtap/systemtap-2.9.ebuild
new file mode 100644
index 0000000..5d676e3
--- /dev/null
+++ b/dev-util/systemtap/systemtap-2.9.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit linux-info autotools eutils python-single-r1
+
+DESCRIPTION="A linux trace/probe tool"
+HOMEPAGE="http://www.sourceware.org/systemtap/"
+SRC_URI="http://www.sourceware.org/${PN}/ftp/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="sqlite"
+
+RDEPEND=">=dev-libs/elfutils-0.142
+ elibc_musl? (
+ sys-libs/argp-standalone
+ sys-libs/obstack-standalone
+ )
+ sys-libs/libcap
+ ${PYTHON_DEPS}
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}
+ >=sys-devel/gettext-0.18.2"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CONFIG_CHECK="~KPROBES ~RELAY ~DEBUG_FS"
+ERROR_KPROBES="${PN} requires support for KProbes Instrumentation (KPROBES) - this can be enabled in 'Instrumentation Support -> Kprobes'."
+ERROR_RELAY="${PN} works with support for user space relay support (RELAY) - this can be enabled in 'General setup -> Kernel->user space relay support (formerly relayfs)'."
+ERROR_DEBUG_FS="${PN} works best with support for Debug Filesystem (DEBUG_FS) - this can be enabled in 'Kernel hacking -> Debug Filesystem'."
+
+DOCS="AUTHORS HACKING NEWS README"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ python_fix_shebang .
+
+ sed -i \
+ -e 's:-Werror::g' \
+ configure.ac \
+ Makefile.am \
+ staprun/Makefile.am \
+ stapdyn/Makefile.am \
+ buildrun.cxx \
+ testsuite/systemtap.unprivileged/unprivileged_probes.exp \
+ testsuite/systemtap.unprivileged/unprivileged_myproc.exp \
+ testsuite/systemtap.base/stmt_rel_user.exp \
+ testsuite/systemtap.base/sdt_va_args.exp \
+ testsuite/systemtap.base/sdt_misc.exp \
+ testsuite/systemtap.base/sdt.exp \
+ scripts/kprobes_test/gen_code.py \
+ || die "Failed to clean up sources"
+
+ epatch "${FILESDIR}"/${P}-musl.patch
+
+ epatch_user
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --without-rpm \
+ --disable-server \
+ --disable-docs \
+ --disable-refdocs \
+ --disable-grapher \
+ $(use_enable sqlite)
+}