Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] systemtap: update to 4.9.
@ 2023-07-01  8:09 hazen2215
  2023-07-01  8:21 ` [PR PATCH] [Updated] " hazen2215
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hazen2215 @ 2023-07-01  8:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

There is a new pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages systemtap
https://github.com/void-linux/void-packages/pull/44755

systemtap: update to 4.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)


A patch file from https://github.com/void-linux/void-packages/pull/44755.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-systemtap-44755.patch --]
[-- Type: text/x-diff, Size: 5674 bytes --]

From 039d965228c1d207bcc5d949156a78a44446d589 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
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               |  14 ++-
 2 files changed, 137 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 <string.h>
+ #include <errno.h>
+ #include <sys/resource.h>
++#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 <elfutils/libdw.h>
+ #include <fcntl.h>
+ #include <nss3/nss.h>
++#include <paths.h>
+ 
+ #ifdef HAVE_RPMCRYPTO_H
+ #include <rpm/rpmcrypto.h>
+@@ -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 <string.h>
++
++#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 <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include "gnu_basename.h"
+ }
+ 
+ #include <cstdio>
+@@ -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 <unistd.h>
+ #include <sys/wait.h>
+ #include <wordexp.h>
++#include <paths.h>
+ }
+ 
+ #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 <spawn.h>
+ #include <assert.h>
+ #include <poll.h>
++#include <unistd.h>
+ }
+ 
+ // 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..4c186b04da6a 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,17 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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
+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"
+CXXFLAGS="$CFLAGS -fpermissive"
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	makedepends+=" musl-obstack-devel"
+fi
 
 systemtap-devel_package() {
 	depends="systemtap-${version}_${revision}"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] systemtap: update to 4.9.
  2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
@ 2023-07-01  8:21 ` hazen2215
  2023-07-01  8:42 ` hazen2215
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hazen2215 @ 2023-07-01  8:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages systemtap
https://github.com/void-linux/void-packages/pull/44755

systemtap: update to 4.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)


A patch file from https://github.com/void-linux/void-packages/pull/44755.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-systemtap-44755.patch --]
[-- Type: text/x-diff, Size: 5679 bytes --]

From aab9b699063cbbf9aa116da23b0e6b55549d6044 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
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 <string.h>
+ #include <errno.h>
+ #include <sys/resource.h>
++#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 <elfutils/libdw.h>
+ #include <fcntl.h>
+ #include <nss3/nss.h>
++#include <paths.h>
+ 
+ #ifdef HAVE_RPMCRYPTO_H
+ #include <rpm/rpmcrypto.h>
+@@ -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 <string.h>
++
++#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 <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include "gnu_basename.h"
+ }
+ 
+ #include <cstdio>
+@@ -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 <unistd.h>
+ #include <sys/wait.h>
+ #include <wordexp.h>
++#include <paths.h>
+ }
+ 
+ #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 <spawn.h>
+ #include <assert.h>
+ #include <poll.h>
++#include <unistd.h>
+ }
+ 
+ // 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 <orphan@voidlinux.org>"
 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}"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] systemtap: update to 4.9.
  2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
  2023-07-01  8:21 ` [PR PATCH] [Updated] " hazen2215
@ 2023-07-01  8:42 ` hazen2215
  2023-07-01 15:16 ` [PR REVIEW] " Duncaen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hazen2215 @ 2023-07-01  8:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages systemtap
https://github.com/void-linux/void-packages/pull/44755

systemtap: update to 4.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)


A patch file from https://github.com/void-linux/void-packages/pull/44755.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-systemtap-44755.patch --]
[-- Type: text/x-diff, Size: 5698 bytes --]

From 4aca9a775d404400a8fd0f01151ce8975be11f84 Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
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               |  16 ++-
 2 files changed, 138 insertions(+), 5 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 <string.h>
+ #include <errno.h>
+ #include <sys/resource.h>
++#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 <elfutils/libdw.h>
+ #include <fcntl.h>
+ #include <nss3/nss.h>
++#include <paths.h>
+ 
+ #ifdef HAVE_RPMCRYPTO_H
+ #include <rpm/rpmcrypto.h>
+@@ -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 <string.h>
++
++#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 <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include "gnu_basename.h"
+ }
+ 
+ #include <cstdio>
+@@ -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 <unistd.h>
+ #include <sys/wait.h>
+ #include <wordexp.h>
++#include <paths.h>
+ }
+ 
+ #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 <spawn.h>
+ #include <assert.h>
+ #include <poll.h>
++#include <unistd.h>
+ }
+ 
+ // 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..6e7357374cdc 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,17 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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=-Wno-error
+	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"
+	CXXFLAGS="$CFLAGS -fpermissive"
+fi
 
 systemtap-devel_package() {
 	depends="systemtap-${version}_${revision}"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR REVIEW] systemtap: update to 4.9.
  2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
  2023-07-01  8:21 ` [PR PATCH] [Updated] " hazen2215
  2023-07-01  8:42 ` hazen2215
@ 2023-07-01 15:16 ` Duncaen
  2023-07-02  5:07 ` [PR PATCH] [Updated] " hazen2215
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2023-07-01 15:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

New review comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/44755#discussion_r1248868736

Comment:
`-Wno-error` should probably always be set, not just for musl.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] systemtap: update to 4.9.
  2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
                   ` (2 preceding siblings ...)
  2023-07-01 15:16 ` [PR REVIEW] " Duncaen
@ 2023-07-02  5:07 ` hazen2215
  2023-07-02  8:16 ` hazen2215
  2023-07-02 20:56 ` [PR PATCH] [Merged]: " Duncaen
  5 siblings, 0 replies; 7+ messages in thread
From: hazen2215 @ 2023-07-02  5:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

There is an updated pull request by hazen2215 against master on the void-packages repository

https://github.com/hazen2215/void-packages systemtap
https://github.com/void-linux/void-packages/pull/44755

systemtap: update to 4.9.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)


A patch file from https://github.com/void-linux/void-packages/pull/44755.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-systemtap-44755.patch --]
[-- Type: text/x-diff, Size: 5692 bytes --]

From cb9726805eb82f22253333b67f32a2c58c79664f Mon Sep 17 00:00:00 2001
From: hazen2215 <haz@disroot.org>
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               |  16 ++-
 2 files changed, 139 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 <string.h>
+ #include <errno.h>
+ #include <sys/resource.h>
++#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 <elfutils/libdw.h>
+ #include <fcntl.h>
+ #include <nss3/nss.h>
++#include <paths.h>
+ 
+ #ifdef HAVE_RPMCRYPTO_H
+ #include <rpm/rpmcrypto.h>
+@@ -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 <string.h>
++
++#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 <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include "gnu_basename.h"
+ }
+ 
+ #include <cstdio>
+@@ -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 <unistd.h>
+ #include <sys/wait.h>
+ #include <wordexp.h>
++#include <paths.h>
+ }
+ 
+ #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 <spawn.h>
+ #include <assert.h>
+ #include <poll.h>
++#include <unistd.h>
+ }
+ 
+ // 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..0c4bc2ebcaa3 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,19 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 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"
+	CXXFLAGS=-fpermissive
+fi
+
+CXXFLAGS+=" $CFLAGS"
 
 systemtap-devel_package() {
 	depends="systemtap-${version}_${revision}"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: systemtap: update to 4.9.
  2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
                   ` (3 preceding siblings ...)
  2023-07-02  5:07 ` [PR PATCH] [Updated] " hazen2215
@ 2023-07-02  8:16 ` hazen2215
  2023-07-02 20:56 ` [PR PATCH] [Merged]: " Duncaen
  5 siblings, 0 replies; 7+ messages in thread
From: hazen2215 @ 2023-07-02  8:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

New comment by hazen2215 on void-packages repository

https://github.com/void-linux/void-packages/pull/44755#issuecomment-1616436906

Comment:
Applied suggestion.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Merged]: systemtap: update to 4.9.
  2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
                   ` (4 preceding siblings ...)
  2023-07-02  8:16 ` hazen2215
@ 2023-07-02 20:56 ` Duncaen
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2023-07-02 20:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

There's a merged pull request on the void-packages repository

systemtap: update to 4.9.
https://github.com/void-linux/void-packages/pull/44755

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-02 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-01  8:09 [PR PATCH] systemtap: update to 4.9 hazen2215
2023-07-01  8:21 ` [PR PATCH] [Updated] " hazen2215
2023-07-01  8:42 ` hazen2215
2023-07-01 15:16 ` [PR REVIEW] " Duncaen
2023-07-02  5:07 ` [PR PATCH] [Updated] " hazen2215
2023-07-02  8:16 ` hazen2215
2023-07-02 20:56 ` [PR PATCH] [Merged]: " Duncaen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).