From aab9b699063cbbf9aa116da23b0e6b55549d6044 Mon Sep 17 00:00:00 2001 From: hazen2215 Date: Thu, 29 Jun 2023 20:42:35 +0900 Subject: [PATCH] systemtap: update to 4.9. --- srcpkgs/systemtap/patches/fix-musl.patch | 127 +++++++++++++++++++++++ srcpkgs/systemtap/template | 15 ++- 2 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/systemtap/patches/fix-musl.patch diff --git a/srcpkgs/systemtap/patches/fix-musl.patch b/srcpkgs/systemtap/patches/fix-musl.patch new file mode 100644 index 000000000000..9d1039100c3b --- /dev/null +++ b/srcpkgs/systemtap/patches/fix-musl.patch @@ -0,0 +1,127 @@ +diff --git a/buildrun.cxx b/buildrun.cxx +index 0048d07..904ce47 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -29,6 +29,7 @@ extern "C" { + #include + #include + #include ++#include "gnu_basename.h" + } + + // A bit of obfuscation for Gentoo's sake. +@@ -943,7 +944,7 @@ make_kernel_run_command (systemtap_session& s, const string& remotedir, + if (remotedir.empty()) + opt_u.append(s.uprobes_path); + else +- opt_u.append(remotedir + "/" + basename(s.uprobes_path.c_str())); ++ opt_u.append(remotedir + "/" + gnu_basename(s.uprobes_path.c_str())); + } + cmd.push_back(opt_u); + } +diff --git a/client-http.cxx b/client-http.cxx +index fca7362..d6096b9 100644 +--- a/client-http.cxx ++++ b/client-http.cxx +@@ -38,6 +38,7 @@ extern "C" { + #include + #include + #include ++#include + + #ifdef HAVE_RPMCRYPTO_H + #include +@@ -1016,7 +1017,7 @@ http_client_backend::include_file_or_directory (const string &subdir, + + // 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 --git a/client-nss.cxx b/client-nss.cxx +index 55266fe..a775ed1 100644 +--- a/client-nss.cxx ++++ b/client-nss.cxx +@@ -576,7 +576,7 @@ nss_client_backend::include_file_or_directory (const string &subdir, + + // 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 --git a/gnu_basename.h b/gnu_basename.h +new file mode 100644 +index 0000000..dce5f19 +--- /dev/null ++++ b/gnu_basename.h +@@ -0,0 +1,12 @@ ++#ifndef GNU_BASENAME_H ++#define GNU_BASENAME_H ++ ++#include ++ ++#if defined(__GLIBC__) ++#define gnu_basename(src) basename(src) ++#else ++#define gnu_basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src) ++#endif ++ ++#endif +diff --git a/remote.cxx b/remote.cxx +index bffeaa9..bd6c7c4 100644 +--- a/remote.cxx ++++ b/remote.cxx +@@ -16,6 +16,7 @@ extern "C" { + #include + #include + #include ++#include "gnu_basename.h" + } + + #include +@@ -472,7 +473,7 @@ class stapsh : public remote { + + if (!s->uprobes_path.empty()) + { +- string remoteuprobes = basename(s->uprobes_path.c_str()); ++ string remoteuprobes = gnu_basename(s->uprobes_path.c_str()); + if ((rc = send_file(s->uprobes_path, remoteuprobes))) + return rc; + +diff --git a/session.cxx b/session.cxx +index a22baab..77eedf9 100644 +--- a/session.cxx ++++ b/session.cxx +@@ -42,6 +42,7 @@ extern "C" { + #include + #include + #include ++#include + } + + #if HAVE_NSS +@@ -1537,7 +1538,7 @@ systemtap_session::parse_cmdline (int argc, char * const argv []) + } else { + char *spath; + assert(optarg); +- spath = canonicalize_file_name (optarg); ++ spath = realpath (optarg, NULL); + if (spath == NULL) { + cerr << _F("ERROR: %s is an invalid directory for --sysroot", optarg) << endl; + return 1; +diff --git a/util.h b/util.h +index c708aa6..ef4a6fe 100644 +--- a/util.h ++++ b/util.h +@@ -27,6 +27,7 @@ extern "C" { + #include + #include + #include ++#include + } + + // Sanity check C++11 support. We're only requiring GCC 4.4's level of diff --git a/srcpkgs/systemtap/template b/srcpkgs/systemtap/template index 8441d545c435..0c5cfcbab386 100644 --- a/srcpkgs/systemtap/template +++ b/srcpkgs/systemtap/template @@ -1,8 +1,7 @@ # Template file for 'systemtap' pkgname=systemtap -version=4.5 +version=4.9 revision=1 -archs="i686 x86_64 armv6l armv7l aarch64 ppc64le" build_style=gnu-configure hostmakedepends="python3" makedepends="elfutils-devel" @@ -12,10 +11,18 @@ maintainer="Orphaned " license="GPL-3.0-or-later" homepage="https://sourceware.org/systemtap/" distfiles="https://sourceware.org/pub/systemtap/releases/systemtap-${version}.tar.gz" -checksum=75078ed37e0dd2a769c9d1f9394170b2d9f4d7daa425f43ca80c13bad6cfc925 +checksum=d01033baea9d0af52a65e70167816931f4b856427a53ff2ab30e4b45f6ad3a98 python_version=3 CFLAGS=-Wno-error -CXXFLAGS=-Wno-error + +if [ "$XBPS_TARGET_LIBC" = musl ]; then + makedepends+=" musl-obstack-devel" + CFLAGS+=" -DFNM_EXTMATCH=0" + CFLAGS+=" -DFTW_ACTIONRETVAL=16 -DFTW_CONTINUE=0 -DFTW_SKIP_SUBTREE=2" + CFLAGS+=" -D__off_t=off_t -D__uint32_t=uint32_t -D__uint64_t=uint64_t" +fi + +CXXFLAGS="$CFLAGS -fpermissive" systemtap-devel_package() { depends="systemtap-${version}_${revision}"