summaryrefslogtreecommitdiff
path: root/dev-debug/strace
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-19 20:08:27 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-19 20:08:27 +0000
commit2b2f431a0021b4787ca3c028cefb30ad81347778 (patch)
tree951e0155f53027c8fd29eaba26df4f08292668d5 /dev-debug/strace
parentd725480af7cbc67d784e5d96f973fa41e9030123 (diff)
gentoo auto-resync : 19:01:2024 - 20:08:27
Diffstat (limited to 'dev-debug/strace')
-rw-r--r--dev-debug/strace/Manifest13
-rw-r--r--dev-debug/strace/files/strace-5.11-static.patch178
-rw-r--r--dev-debug/strace/files/strace-6.4-linux-headers-6.5.patch160
-rw-r--r--dev-debug/strace/files/strace-6.5-static.patch178
-rw-r--r--dev-debug/strace/metadata.xml25
-rw-r--r--dev-debug/strace/strace-6.2.ebuild109
-rw-r--r--dev-debug/strace/strace-6.3.ebuild109
-rw-r--r--dev-debug/strace/strace-6.4-r1.ebuild110
-rw-r--r--dev-debug/strace/strace-6.6.ebuild109
-rw-r--r--dev-debug/strace/strace-9999.ebuild109
10 files changed, 1100 insertions, 0 deletions
diff --git a/dev-debug/strace/Manifest b/dev-debug/strace/Manifest
new file mode 100644
index 000000000000..23d69e7cb072
--- /dev/null
+++ b/dev-debug/strace/Manifest
@@ -0,0 +1,13 @@
+AUX strace-5.11-static.patch 5306 BLAKE2B 24150fcdf0ff75c4698542914bcd0fd39df9794f39ce0d16dac6dc3b689365e124d8d77a75a8fe81caff9432679563d84ffd31add74edb4c8f83aec28ff2f078 SHA512 bbeecbfd73109d21732acdaa28d5b4c82b23b7165f09e78e62cad68f9ac63dfb4c7a1c2eb8bdc642dda9f07d62e286ab46a2be236b5f03e1e6f9920f3093ede8
+AUX strace-6.4-linux-headers-6.5.patch 5283 BLAKE2B 67707d990124f3ebc05a33728251fb313fbde73b3f1ae72c046ea0c7faa05df26693fcdd8cd9ea98d8eb0c43dac5d35486af5392f7ad5f6cdbd8a05ad9991866 SHA512 ca11e21f848a2e7f128c10bc717ca6486caecbc43d45b04ee6c4c96014e645a43fec11d52c9b2f4911273b9d100c97b1956115dc7cfe5766c7fc9805952d88b5
+AUX strace-6.5-static.patch 5425 BLAKE2B c7b2477ba5a8b5f23ed28763e1149406f7f434ce014aa51069f80a8cf0cdfaa5dbfa58cbba12b0de1eef50e2ff7bd89c4d2b9f1e1587a889d7dbc5486045be2e SHA512 67f698522f1cd47f994baf8d7b7640ef0d36ea4bf8cf5069664e7219164dae949e53c136520d96b476b085023855db349e89937cc017ff4a77d5b8da09ab5bed
+DIST strace-6.2.tar.xz 2364280 BLAKE2B 8e51cb3e426e9b99d598b4fcece21ba7873e81468cddae04c2f0b1a48dc40643c626acadd226389c33dbef5350b502817d3459d445fc17cce149f7e501c15ae2 SHA512 56708faa3f73c0673c98a5b8b8fe35289ecf2870f4f775bcb7a6be59451ef84685564c0129aca15b576d851f8efa1ff760e27658b914d1f31adf4de3b1ad721f
+DIST strace-6.3.tar.xz 2382284 BLAKE2B 7373ebddd6f23713b752ed91598e536d61e08865907c7825dd3492574c7feb0ad6d56bea0e144e1082ac1882d68bb5f160f25e70bfc6e2fd47571ef2c40403fb SHA512 2b0a57e3ee8a23eb3882123149cd732c568322614bf8fde69fabcea64d0d4e3c46c71d63183e0e8d9f8744a7b1cebc823cc67023660c37547f5b854fcc1ca9df
+DIST strace-6.4.tar.xz 2391828 BLAKE2B a9d359679bc5cc61061eb9f19a6156637f12509cb1045462b1547cba8a1218a9b2a4d3b87cf4a33856500515cc0bd457c1374b0ed349293821d80e3cc0de0452 SHA512 29f47195b2766dc0d2907aba2d561e87ec87939251d07fd82d22ffdd3c864944ab0c47eabd7b13272345dfc5dfae7ca435c94fd5ccc297dd46e0747c6d463e01
+DIST strace-6.6.tar.xz 2420364 BLAKE2B f1465fec58ac20ccce6a88441a34b1402e5c51f0bb4b7963f69b5ab5019a8c8722e3406c6f93c10c1eea11d17de7f9874895d6f4df24cf9ec42a18f36267687b SHA512 77ea45c72e513f6c07026cd9b2cc1a84696a5a35cdd3b06dd4a360fb9f9196958e3f6133b4a9c91e091c24066ba29e0330b6459d18a9c390caae2dba97ab399b
+EBUILD strace-6.2.ebuild 2490 BLAKE2B 653cf660337917bf4221d4e71774f8bfc5048a3abb88602eae2778f921127b00c0695feedba0b265d382b74662e844037d59621398505b0dbff7a7d14494abd2 SHA512 c6515a2f9ebdbcc45f6bdad30999079858aa98e439c57300d5153de6c0c9e7fb2f7cea047ec0ea6850bff02d82524451ddfadbc9031f9733d812d8c1983c1ed9
+EBUILD strace-6.3.ebuild 2489 BLAKE2B d3d5e9c65b8b2ff3152b0f1bb9e43405b7317d9811b3358905649bff46a8e3550b2fb58c2f6e626dd68f3d1614ca8fa3ab120a4c672dc09e0136f05718b8b25c SHA512 354d679ea3f2b35cd30673c55c1157b09a6ea798d1ed03245f6dfddb0f259138096f3b851601e596aca6470b0f2ca9a99d244a65403623a1bb1f9c14e14453a6
+EBUILD strace-6.4-r1.ebuild 2531 BLAKE2B 33586a3feb9968878a516d333c80ef2d9a0b221e0bc1bf2ea805107eb2694e97027ad623a1cf04b400b4fefb876cd83031de639147a5181e30ff4ed5e35ef47c SHA512 81e58dcb36a23fcdbdce03c54a429ca248769ca8359f60ee918e903ce9c6609d564e4dd6574afa319c013a546c3b8e07d15d96d6e834825d98cfeed8731f71f3
+EBUILD strace-6.6.ebuild 2486 BLAKE2B e20bf26cac56713e01e40b4c5c40a3d4c6906c005de790f138d8a0715ddf5d767d642e11a41383732bc62105160987af0ef0b1183d777a04b6d2afd4331c2764 SHA512 832509181c592b61d0b7b37b5bdaea65045ca0581de1e594520b9f74bacd569acb57de36a08b263e67780668f940736515aa59cb0395a81925d191352a97bba2
+EBUILD strace-9999.ebuild 2495 BLAKE2B 46f3afcc4ab99e928644e0c2550d5f0603856e3f406413d48e6cf97a9412c10bb5151f51fe880c599bb9f1fa169134914bfb6c11d4c15319bec048e13909ee56 SHA512 0ae6f297572908448c5f2067d12a3d85a03d583ab1743ee60a996aec4e72b54b4a137c081650aa3248ea3fef6051bc81e67c6723f215d60188d781a9bb03712c
+MISC metadata.xml 844 BLAKE2B 5c0ea5129bf202dbd4c7505ec5585f6ea43ef21098a776f4ed632f7a34e4f8b2705f4ded75ef2dd8e9c7ed53704d140efef27eba08076e9314820633e3cd602e SHA512 8c4f6e2b4f6914b91ee21cca3d70bb6b42571f9e57441b0e53a9f21591a521cc4f0b815e654dd3ac820618fdc92411c3448cffef113ea16c73121a1e242bd505
diff --git a/dev-debug/strace/files/strace-5.11-static.patch b/dev-debug/strace/files/strace-5.11-static.patch
new file mode 100644
index 000000000000..146ace0dd2e7
--- /dev/null
+++ b/dev-debug/strace/files/strace-5.11-static.patch
@@ -0,0 +1,178 @@
+--- strace-5.11/configure.ac
++++ strace-5.11/configure.ac
+@@ -47,6 +47,15 @@
+ AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date])
+ AC_SUBST([MANPAGE_DATE], [manpage_date])
+
++AC_ARG_ENABLE([static],
++ [AS_HELP_STRING([--enable-static],
++ [link strace statically])],
++ [], [enable_static=no])
++if test "$enable_static" = "yes"; then
++ # Add -pthread since strace wants -lrt for timer_create, and -lrt uses -lpthread.
++ LDFLAGS="$LDFLAGS -pthread -static"
++fi
++
+ AC_C_BIGENDIAN
+
+ dnl arch-specific default for --enable-gcc-Werror
+--- strace-5.11/m4/st_libdw.m4
++++ strace-5.11/m4/st_libdw.m4
+@@ -8,7 +8,6 @@
+ AC_DEFUN([st_ARG_LIBDW], [dnl
+
+ : ${libdw_CPPFLAGS=}
+-: ${libdw_CFLAGS=}
+ : ${libdw_LDFLAGS=}
+ : ${libdw_LIBS=}
+
+@@ -34,48 +33,14 @@
+ have_libdw=
+
+ AS_IF([test "x$with_libdw" != xno && test "x$use_unwinder" = x],
+- [saved_CPPFLAGS="$CPPFLAGS"
+- saved_CFLAGS="$CFLAGS"
+- CPPFLAGS="$CPPFLAGS $libdw_CPPFLAGS"
+- CFLAGS="$CFLAGS $libdw_CFLAGS"
+-
+- AC_CHECK_HEADERS([elfutils/libdwfl.h],
+- [AC_CHECK_LIB([dw], [dwfl_linux_proc_attach],
+- [libdw_LIBS="-ldw $libdw_LIBS"
+- AC_CACHE_CHECK([for elfutils version],
+- [st_cv_ELFUTILS_VERSION],
+- [[st_cv_ELFUTILS_VERSION="$(echo _ELFUTILS_VERSION |
+- $CPP $CPPFLAGS -P -imacros elfutils/version.h - |
+- grep '^[0-9]')"
+- test -n "$st_cv_ELFUTILS_VERSION" ||
+- st_cv_ELFUTILS_VERSION=0
+- ]]
+- )
+- AS_IF([test "$st_cv_ELFUTILS_VERSION" -ge 164],
+- [have_libdw=yes],
+- [AS_IF([test "x$with_libdw" = xyes],
+- [AC_MSG_ERROR([elfutils version >= 164 is required for stack tracing support])],
+- [AC_MSG_WARN([elfutils version >= 164 is required for stack tracing support])]
+- )
+- ]
+- )
+- ],
+- [AS_IF([test "x$with_libdw" = xyes],
+- [AC_MSG_FAILURE([failed to find dwfl_linux_proc_attach in libdw])],
+- )
+- ],
+- [$libdw_LDFLAGS $libdw_LIBS]
+- )
+- ],
+- [AS_IF([test "x$with_libdw" = xyes],
+- [AC_MSG_FAILURE([failed to find elfutils/libdwfl.h])]
+- )
+- ]
+- )
+-
+- CFLAGS="$saved_CFLAGS"
+- CPPFLAGS="$saved_CPPFLAGS"
+- ]
++ [if test "$enable_static" = "yes"; then
++ PKG_CHECK_MODULES_STATIC([LIBDW], [libdw >= 0.164])
++ else
++ PKG_CHECK_MODULES([LIBDW], [libdw >= 0.164])
++ fi
++ have_libdw=yes
++ libdw_CPPFLAGS="$LIBDW_CFLAGS"
++ libdw_LIBS="$LIBDW_LIBS"]
+ )
+
+ AS_IF([test "x$have_libdw" = xyes],
+@@ -84,7 +49,6 @@
+ [Whether to use libdw for stack tracing]
+ )
+ AC_SUBST(libdw_CPPFLAGS)
+- AC_SUBST(libdw_CFLAGS)
+ AC_SUBST(libdw_LDFLAGS)
+ AC_SUBST(libdw_LIBS)
+ ]
+--- strace-5.11/m4/st_libunwind.m4
++++ strace-5.11/m4/st_libunwind.m4
+@@ -28,64 +28,14 @@
+ AC_DEFUN([st_LIBUNWIND], [dnl
+
+ AS_IF([test "x$with_libunwind" != xno && test "x$use_unwinder" = x],
+- [saved_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
+-
+- AC_CHECK_HEADERS([libunwind-ptrace.h],
+- [saved_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
+-
+- AC_CHECK_LIB([unwind], [backtrace],
+- [libunwind_LIBS="-lunwind $libunwind_LIBS"
+-
+- AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
+- saved_LIBS="$LIBS"
+- LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
+-
+- AC_LINK_IFELSE(
+- [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
+- [[return !unw_create_addr_space(0, 0)]])
+- ],
+- [AC_MSG_RESULT([yes])
+- libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
+-
+- AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
+- [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
+- use_unwinder=libunwind
+- ],
+- [if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
+- fi
+- ],
+- [$libunwind_LIBS]
+- )
+- ],
+- [AC_MSG_RESULT([no])
+- if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
+- fi
+- ]
+- )
+-
+- LIBS="$saved_LIBS"
+- ],
+- [if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find libunwind])
+- fi
+- ],
+- [$libunwind_LIBS]
+- )
+-
+- LDFLAGS="$saved_LDFLAGS"
+- ],
+- [if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
+- fi
+- ]
+- )
+-
+- CPPFLAGS="$saved_CPPFLAGS"
+- ]
++ [if test "$enable_static" = "yes"; then
++ PKG_CHECK_MODULES_STATIC([LIBUNWIND], [libunwind libunwind-generic libunwind-ptrace])
++ else
++ PKG_CHECK_MODULES([LIBUNWIND], [libunwind libunwind-generic libunwind-ptrace])
++ fi
++ use_unwinder="libunwind"
++ libunwind_CPPFLAGS="$LIBUNWIND_CFLAGS"
++ libunwind_LIBS="$LIBUNWIND_LIBS"]
+ )
+
+ if test "x$use_unwinder" = xlibunwind; then
+--- strace-5.11/src/Makefile.am
++++ strace-5.11/src/Makefile.am
+@@ -393,7 +393,6 @@
+ if USE_LIBDW
+ libstrace_a_SOURCES += unwind-libdw.c
+ strace_CPPFLAGS += $(libdw_CPPFLAGS)
+-strace_CFLAGS += $(libdw_CFLAGS)
+ strace_LDFLAGS += $(libdw_LDFLAGS)
+ strace_LDADD += $(libdw_LIBS)
+ endif
diff --git a/dev-debug/strace/files/strace-6.4-linux-headers-6.5.patch b/dev-debug/strace/files/strace-6.4-linux-headers-6.5.patch
new file mode 100644
index 000000000000..2814dee76258
--- /dev/null
+++ b/dev-debug/strace/files/strace-6.4-linux-headers-6.5.patch
@@ -0,0 +1,160 @@
+https://bugs.gentoo.org/913170
+https://github.com/strace/strace/issues/262
+https://github.com/strace/strace/commit/a8cec18845220cc82e45014ffdcab449ad664584
+https://github.com/strace/strace/commit/e0da3633669fcb829dd8d902d15443a755bd10fb
+
+From a8cec18845220cc82e45014ffdcab449ad664584 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@strace.io>
+Date: Tue, 4 Jul 2023 08:00:00 +0000
+Subject: [PATCH] ptp: add max_phase_adj field and update rsv field of struct
+ ptp_clock_caps
+
+* bundled/linux/include/uapi/linux/ptp_clock.h (struct ptp_clock_caps):
+Add max_phase_adj field and update rsv field following the change
+introduced by Linux kernel commit v6.5-rc1~163^2~65^2~4.
+* src/ptp.c (ptp_ioctl): Likewise.
+* tests/ioctl_ptp.c (test_no_device): Update expected output.
+--- a/bundled/linux/include/uapi/linux/ptp_clock.h
++++ b/bundled/linux/include/uapi/linux/ptp_clock.h
+@@ -95,7 +95,8 @@ struct ptp_clock_caps {
+ int cross_timestamping;
+ /* Whether the clock supports adjust phase */
+ int adjust_phase;
+- int rsv[12]; /* Reserved for future use. */
++ int max_phase_adj; /* Maximum phase adjustment in nanoseconds. */
++ int rsv[11]; /* Reserved for future use. */
+ };
+
+ struct ptp_extts_request {
+--- a/src/ptp.c
++++ b/src/ptp.c
+@@ -78,7 +78,7 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
+ case PTP_CLOCK_GETCAPS:
+ case PTP_CLOCK_GETCAPS2: {
+ struct ptp_clock_caps caps;
+- CHECK_TYPE_SIZE(caps.rsv, sizeof(unsigned int) * 12);
++ CHECK_TYPE_SIZE(caps.rsv, sizeof(unsigned int) * 11);
+ CHECK_IOCTL_SIZE(PTP_CLOCK_GETCAPS, 80);
+ CHECK_IOCTL_SIZE(PTP_CLOCK_GETCAPS2, 80);
+
+@@ -106,6 +106,8 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
+ PRINT_FIELD_D(caps, cross_timestamping);
+ tprint_struct_next();
+ PRINT_FIELD_D(caps, adjust_phase);
++ tprint_struct_next();
++ PRINT_FIELD_D(caps, max_phase_adj);
+ PRINT_RSV(caps, rsv);
+ tprint_struct_end();
+ break;
+--- a/tests/ioctl_ptp.c
++++ b/tests/ioctl_ptp.c
+@@ -151,7 +151,7 @@ test_no_device(void)
+ if (rc >= 0) {
+ printf("{max_adj=0, n_alarm=0, n_ext_ts=0, n_per_out=0"
+ ", pps=0, n_pins=0, cross_timestamping=0"
+- ", adjust_phase=0}");
++ ", adjust_phase=0, max_phase_adj=0}");
+ } else {
+ printf("%p", caps);
+ }
+@@ -166,7 +166,8 @@ test_no_device(void)
+ ", pps=-2136948508, n_pins=-2136948507"
+ ", cross_timestamping=-2136948506"
+ ", adjust_phase=-2136948505"
+- ", rsv=[0x80a0c0e8, 0x80a0c0e9, 0x80a0c0ea"
++ ", max_phase_adj=-2136948504"
++ ", rsv=[0x80a0c0e9, 0x80a0c0ea"
+ ", 0x80a0c0eb, 0x80a0c0ec, 0x80a0c0ed"
+ ", 0x80a0c0ee, 0x80a0c0ef, 0x80a0c0f0"
+ ", 0x80a0c0f1, 0x80a0c0f2, 0x80a0c0f3]}");
+
+From e0da3633669fcb829dd8d902d15443a755bd10fb Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@strace.io>
+Date: Mon, 3 Jul 2023 08:00:00 +0000
+Subject: [PATCH] io_uring: rename resv2 fields of io_[cs]qring_offsets to
+ user_addr
+
+* bundled/linux/include/uapi/linux/io_uring.h (struct io_sqring_offsets,
+struct io_cqring_offsets): Rename resv2 to user_addr following
+the change introduced by Linux kernel commit v6.5-rc1~235^2~32.
+* src/io_uring.c (print_io_sqring_offsets, print_io_cqring_offsets):
+Likewise.
+* tests/io_uring_setup.c (main): Update expected output.
+--- a/bundled/linux/include/uapi/linux/io_uring.h
++++ b/bundled/linux/include/uapi/linux/io_uring.h
+@@ -406,7 +406,7 @@ struct io_sqring_offsets {
+ __u32 dropped;
+ __u32 array;
+ __u32 resv1;
+- __u64 resv2;
++ __u64 user_addr;
+ };
+
+ /*
+@@ -425,7 +425,7 @@ struct io_cqring_offsets {
+ __u32 cqes;
+ __u32 flags;
+ __u32 resv1;
+- __u64 resv2;
++ __u64 user_addr;
+ };
+
+ /*
+--- a/src/io_uring.c
++++ b/src/io_uring.c
+@@ -45,10 +45,8 @@ print_io_sqring_offsets(const struct io_sqring_offsets *const p)
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, resv1);
+ }
+- if (p->resv2) {
+- tprint_struct_next();
+- PRINT_FIELD_X(*p, resv2);
+- }
++ tprint_struct_next();
++ PRINT_FIELD_X(*p, user_addr);
+ tprint_struct_end();
+ }
+
+@@ -73,10 +71,8 @@ print_io_cqring_offsets(const struct io_cqring_offsets *const p)
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, resv1);
+ }
+- if (p->resv2) {
+- tprint_struct_next();
+- PRINT_FIELD_X(*p, resv2);
+- }
++ tprint_struct_next();
++ PRINT_FIELD_X(*p, user_addr);
+ tprint_struct_end();
+ }
+
+--- a/tests/io_uring_setup.c
++++ b/tests/io_uring_setup.c
+@@ -113,10 +113,9 @@ main(void)
+ params->sq_off.array);
+ if (params->sq_off.resv1)
+ printf(", resv1=%#x", params->sq_off.resv1);
+- if (params->sq_off.resv2)
+- printf(", resv1=%#llx",
+- (unsigned long long)
+- params->sq_off.resv2);
++ printf(", user_addr=%#llx",
++ (unsigned long long)
++ params->sq_off.user_addr);
+
+ printf("}, cq_off={head=%u, tail=%u, ring_mask=%u"
+ ", ring_entries=%u, overflow=%u, cqes=%u"
+@@ -130,10 +129,9 @@ main(void)
+ params->cq_off.flags);
+ if (params->cq_off.resv1)
+ printf(", resv1=%#x", params->cq_off.resv1);
+- if (params->cq_off.resv2)
+- printf(", resv2=%#llx",
+- (unsigned long long)
+- params->cq_off.resv2);
++ printf(", user_addr=%#llx",
++ (unsigned long long)
++ params->cq_off.user_addr);
+
+ printf("}}) = %ld<anon_inode:[io_uring]>\n", rc);
+ }
diff --git a/dev-debug/strace/files/strace-6.5-static.patch b/dev-debug/strace/files/strace-6.5-static.patch
new file mode 100644
index 000000000000..67e4b05ca856
--- /dev/null
+++ b/dev-debug/strace/files/strace-6.5-static.patch
@@ -0,0 +1,178 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -54,6 +54,15 @@ AC_SUBST([STRACE_MANPAGE_DATE], [strace_manpage_date])
+ AC_DEFINE([SLM_MANPAGE_DATE], "[slm_manpage_date]", [Date])
+ AC_SUBST([SLM_MANPAGE_DATE], [slm_manpage_date])
+
++AC_ARG_ENABLE([static],
++ [AS_HELP_STRING([--enable-static],
++ [link strace statically])],
++ [], [enable_static=no])
++if test "$enable_static" = "yes"; then
++ # Add -pthread since strace wants -lrt for timer_create, and -lrt uses -lpthread.
++ LDFLAGS="$LDFLAGS -pthread -static"
++fi
++
+ AC_C_BIGENDIAN
+
+ dnl arch-specific default for --enable-gcc-Werror
+--- a/m4/st_libdw.m4
++++ b/m4/st_libdw.m4
+@@ -8,7 +8,6 @@
+ AC_DEFUN([st_ARG_LIBDW], [dnl
+
+ : ${libdw_CPPFLAGS=}
+-: ${libdw_CFLAGS=}
+ : ${libdw_LDFLAGS=}
+ : ${libdw_LIBS=}
+
+@@ -34,48 +33,14 @@ AC_DEFUN([st_LIBDW], [dnl
+ have_libdw=
+
+ AS_IF([test "x$with_libdw" != xno && test "x$use_unwinder" = x],
+- [saved_CPPFLAGS="$CPPFLAGS"
+- saved_CFLAGS="$CFLAGS"
+- CPPFLAGS="$CPPFLAGS $libdw_CPPFLAGS"
+- CFLAGS="$CFLAGS $libdw_CFLAGS"
+-
+- AC_CHECK_HEADERS([elfutils/libdwfl.h],
+- [AC_CHECK_LIB([dw], [dwfl_linux_proc_attach],
+- [libdw_LIBS="-ldw $libdw_LIBS"
+- AC_CACHE_CHECK([for elfutils version],
+- [st_cv_ELFUTILS_VERSION],
+- [[st_cv_ELFUTILS_VERSION="$(echo _ELFUTILS_VERSION |
+- $CPP $CPPFLAGS -P -imacros elfutils/version.h - |
+- grep '^[0-9]')"
+- test -n "$st_cv_ELFUTILS_VERSION" ||
+- st_cv_ELFUTILS_VERSION=0
+- ]]
+- )
+- AS_IF([test "$st_cv_ELFUTILS_VERSION" -ge 164],
+- [have_libdw=yes],
+- [AS_IF([test "x$with_libdw" = xyes],
+- [AC_MSG_ERROR([elfutils version >= 164 is required for stack tracing support])],
+- [AC_MSG_WARN([elfutils version >= 164 is required for stack tracing support])]
+- )
+- ]
+- )
+- ],
+- [AS_IF([test "x$with_libdw" = xyes],
+- [AC_MSG_FAILURE([failed to find dwfl_linux_proc_attach in libdw])],
+- )
+- ],
+- [$libdw_LDFLAGS $libdw_LIBS]
+- )
+- ],
+- [AS_IF([test "x$with_libdw" = xyes],
+- [AC_MSG_FAILURE([failed to find elfutils/libdwfl.h])]
+- )
+- ]
+- )
+-
+- CFLAGS="$saved_CFLAGS"
+- CPPFLAGS="$saved_CPPFLAGS"
+- ]
++ [if test "$enable_static" = "yes"; then
++ PKG_CHECK_MODULES_STATIC([LIBDW], [libdw >= 0.164])
++ else
++ PKG_CHECK_MODULES([LIBDW], [libdw >= 0.164])
++ fi
++ have_libdw=yes
++ libdw_CPPFLAGS="$LIBDW_CFLAGS"
++ libdw_LIBS="$LIBDW_LIBS"]
+ )
+
+ AS_IF([test "x$have_libdw" = xyes],
+@@ -84,7 +49,6 @@ AS_IF([test "x$have_libdw" = xyes],
+ [Whether to use libdw for stack tracing]
+ )
+ AC_SUBST(libdw_CPPFLAGS)
+- AC_SUBST(libdw_CFLAGS)
+ AC_SUBST(libdw_LDFLAGS)
+ AC_SUBST(libdw_LIBS)
+ ]
+--- a/m4/st_libunwind.m4
++++ b/m4/st_libunwind.m4
+@@ -28,64 +28,14 @@ AC_ARG_WITH([libunwind],
+ AC_DEFUN([st_LIBUNWIND], [dnl
+
+ AS_IF([test "x$with_libunwind" != xno && test "x$use_unwinder" = x],
+- [saved_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
+-
+- AC_CHECK_HEADERS([libunwind-ptrace.h],
+- [saved_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
+-
+- AC_CHECK_LIB([unwind], [backtrace],
+- [libunwind_LIBS="-lunwind $libunwind_LIBS"
+-
+- AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
+- saved_LIBS="$LIBS"
+- LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
+-
+- AC_LINK_IFELSE(
+- [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
+- [[return !unw_create_addr_space(0, 0)]])
+- ],
+- [AC_MSG_RESULT([yes])
+- libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
+-
+- AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
+- [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
+- use_unwinder=libunwind
+- ],
+- [if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace])
+- fi
+- ],
+- [$libunwind_LIBS]
+- )
+- ],
+- [AC_MSG_RESULT([no])
+- if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic])
+- fi
+- ]
+- )
+-
+- LIBS="$saved_LIBS"
+- ],
+- [if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find libunwind])
+- fi
+- ],
+- [$libunwind_LIBS]
+- )
+-
+- LDFLAGS="$saved_LDFLAGS"
+- ],
+- [if test "x$with_libunwind" != xcheck; then
+- AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
+- fi
+- ]
+- )
+-
+- CPPFLAGS="$saved_CPPFLAGS"
+- ]
++ [if test "$enable_static" = "yes"; then
++ PKG_CHECK_MODULES_STATIC([LIBUNWIND], [libunwind libunwind-generic libunwind-ptrace])
++ else
++ PKG_CHECK_MODULES([LIBUNWIND], [libunwind libunwind-generic libunwind-ptrace])
++ fi
++ use_unwinder="libunwind"
++ libunwind_CPPFLAGS="$LIBUNWIND_CFLAGS"
++ libunwind_LIBS="$LIBUNWIND_LIBS"]
+ )
+
+ if test "x$use_unwinder" = xlibunwind; then
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -417,7 +417,6 @@ libstrace_a_SOURCES += unwind.c unwind.h
+ if USE_LIBDW
+ libstrace_a_SOURCES += unwind-libdw.c
+ strace_CPPFLAGS += $(libdw_CPPFLAGS)
+-strace_CFLAGS += $(libdw_CFLAGS)
+ strace_LDFLAGS += $(libdw_LDFLAGS)
+ strace_LDADD += $(libdw_LIBS)
+ endif
diff --git a/dev-debug/strace/metadata.xml b/dev-debug/strace/metadata.xml
new file mode 100644
index 000000000000..2a0ac3bbabf4
--- /dev/null
+++ b/dev-debug/strace/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <flag name="aio">
+ Enable <pkg>dev-libs/libaio</pkg> support for tracing Asynchronous I/O operations
+ </flag>
+ <flag name="unwind">
+ Enable stack backtraces (-k flag) via <pkg>sys-libs/libunwind</pkg>
+ </flag>
+ <flag name="elfutils">
+ Enable stack backtraces (-k flag) via <pkg>dev-libs/elfutils</pkg>
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="github">strace/strace</remote-id>
+ <remote-id type="gitlab">strace/strace</remote-id>
+ <remote-id type="sourceforge">strace</remote-id>
+ <remote-id type="cpe">cpe:/a:strace_project:strace</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-debug/strace/strace-6.2.ebuild b/dev-debug/strace/strace-6.2.ebuild
new file mode 100644
index 000000000000..5335711e7f1a
--- /dev/null
+++ b/dev-debug/strace/strace-6.2.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/strace/strace.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="https://strace.io/"
+
+LICENSE="LGPL-2.1+ test? ( GPL-2+ )"
+SLOT="0"
+IUSE="aio perl selinux static test unwind elfutils"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( unwind elfutils )"
+
+BDEPEND="virtual/pkgconfig"
+LIB_DEPEND="
+ unwind? ( sys-libs/libunwind[static-libs(+)] )
+ elfutils? ( dev-libs/elfutils[static-libs(+)] )
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+"
+# strace only uses the header from libaio to decode structs
+DEPEND="
+ static? ( ${LIB_DEPEND} )
+ aio? ( >=dev-libs/libaio-0.3.106 )
+ sys-kernel/linux-headers
+"
+RDEPEND="
+ !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ perl? ( dev-lang/perl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.11-static.patch"
+)
+
+src_prepare() {
+ default
+
+ if [[ ! -e configure ]] ; then
+ # git generation
+ sed /autoreconf/d -i bootstrap || die
+ edo ./bootstrap
+ [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+ fi
+
+ eautoreconf
+
+ # Stub out the -k test since it's known to be flaky. bug #545812
+ sed -i '1iexit 77' tests*/strace-k.test || die
+}
+
+src_configure() {
+ # Set up the default build settings, and then use the names strace expects.
+ tc-export_build_env BUILD_{CC,CPP}
+ local v bv
+ for v in CC CPP {C,CPP,LD}FLAGS ; do
+ bv="BUILD_${v}"
+ export "${v}_FOR_BUILD=${!bv}"
+ done
+
+ filter-lfs-flags # configure handles this sanely
+
+ export ac_cv_header_libaio_h=$(usex aio)
+ use elibc_musl && export ac_cv_header_stdc=no
+
+ local myeconfargs=(
+ --disable-gcc-Werror
+
+ # Don't require mpers support on non-multilib systems. #649560
+ --enable-mpers=check
+
+ $(use_enable static)
+ $(use_with unwind libunwind)
+ $(use_with elfutils libdw)
+ $(use_with selinux libselinux)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ if has usersandbox ${FEATURES} ; then
+ # bug #643044
+ ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..."
+ return 0
+ fi
+
+ default
+}
+
+src_install() {
+ default
+
+ if use perl ; then
+ exeinto /usr/bin
+ doexe src/strace-graph
+ fi
+
+ dodoc CREDITS
+}
diff --git a/dev-debug/strace/strace-6.3.ebuild b/dev-debug/strace/strace-6.3.ebuild
new file mode 100644
index 000000000000..463bac04d6cb
--- /dev/null
+++ b/dev-debug/strace/strace-6.3.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/strace/strace.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="https://strace.io/"
+
+LICENSE="LGPL-2.1+ test? ( GPL-2+ )"
+SLOT="0"
+IUSE="aio perl selinux static test unwind elfutils"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( unwind elfutils )"
+
+BDEPEND="virtual/pkgconfig"
+LIB_DEPEND="
+ unwind? ( sys-libs/libunwind[static-libs(+)] )
+ elfutils? ( dev-libs/elfutils[static-libs(+)] )
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+"
+# strace only uses the header from libaio to decode structs
+DEPEND="
+ static? ( ${LIB_DEPEND} )
+ aio? ( >=dev-libs/libaio-0.3.106 )
+ sys-kernel/linux-headers
+"
+RDEPEND="
+ !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ perl? ( dev-lang/perl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.11-static.patch"
+)
+
+src_prepare() {
+ default
+
+ if [[ ! -e configure ]] ; then
+ # git generation
+ sed /autoreconf/d -i bootstrap || die
+ edo ./bootstrap
+ [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+ fi
+
+ eautoreconf
+
+ # Stub out the -k test since it's known to be flaky. bug #545812
+ sed -i '1iexit 77' tests*/strace-k.test || die
+}
+
+src_configure() {
+ # Set up the default build settings, and then use the names strace expects.
+ tc-export_build_env BUILD_{CC,CPP}
+ local v bv
+ for v in CC CPP {C,CPP,LD}FLAGS ; do
+ bv="BUILD_${v}"
+ export "${v}_FOR_BUILD=${!bv}"
+ done
+
+ filter-lfs-flags # configure handles this sanely
+
+ export ac_cv_header_libaio_h=$(usex aio)
+ use elibc_musl && export ac_cv_header_stdc=no
+
+ local myeconfargs=(
+ --disable-gcc-Werror
+
+ # Don't require mpers support on non-multilib systems. #649560
+ --enable-mpers=check
+
+ $(use_enable static)
+ $(use_with unwind libunwind)
+ $(use_with elfutils libdw)
+ $(use_with selinux libselinux)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ if has usersandbox ${FEATURES} ; then
+ # bug #643044
+ ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..."
+ return 0
+ fi
+
+ default
+}
+
+src_install() {
+ default
+
+ if use perl ; then
+ exeinto /usr/bin
+ doexe src/strace-graph
+ fi
+
+ dodoc CREDITS
+}
diff --git a/dev-debug/strace/strace-6.4-r1.ebuild b/dev-debug/strace/strace-6.4-r1.ebuild
new file mode 100644
index 000000000000..f71d7670bcd2
--- /dev/null
+++ b/dev-debug/strace/strace-6.4-r1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic toolchain-funcs
+
+DESCRIPTION="Useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="https://strace.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/strace/strace.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="LGPL-2.1+ test? ( GPL-2+ )"
+SLOT="0"
+IUSE="aio perl selinux static test unwind elfutils"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( unwind elfutils )"
+
+BDEPEND="virtual/pkgconfig"
+LIB_DEPEND="
+ unwind? ( sys-libs/libunwind[static-libs(+)] )
+ elfutils? ( dev-libs/elfutils[static-libs(+)] )
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+"
+# strace only uses the header from libaio to decode structs
+DEPEND="
+ static? ( ${LIB_DEPEND} )
+ aio? ( >=dev-libs/libaio-0.3.106 )
+ sys-kernel/linux-headers
+"
+RDEPEND="
+ !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ perl? ( dev-lang/perl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.11-static.patch"
+ "${FILESDIR}/${P}-linux-headers-6.5.patch"
+)
+
+src_prepare() {
+ default
+
+ if [[ ! -e configure ]] ; then
+ # git generation
+ sed /autoreconf/d -i bootstrap || die
+ edo ./bootstrap
+ [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+ fi
+
+ eautoreconf
+
+ # Stub out the -k test since it's known to be flaky. bug #545812
+ sed -i '1iexit 77' tests*/strace-k.test || die
+}
+
+src_configure() {
+ # Set up the default build settings, and then use the names strace expects.
+ tc-export_build_env BUILD_{CC,CPP}
+ local v bv
+ for v in CC CPP {C,CPP,LD}FLAGS ; do
+ bv="BUILD_${v}"
+ export "${v}_FOR_BUILD=${!bv}"
+ done
+
+ filter-lfs-flags # configure handles this sanely
+
+ export ac_cv_header_libaio_h=$(usex aio)
+ use elibc_musl && export ac_cv_header_stdc=no
+
+ local myeconfargs=(
+ --disable-gcc-Werror
+
+ # Don't require mpers support on non-multilib systems. #649560
+ --enable-mpers=check
+
+ $(use_enable static)
+ $(use_with unwind libunwind)
+ $(use_with elfutils libdw)
+ $(use_with selinux libselinux)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ if has usersandbox ${FEATURES} ; then
+ # bug #643044
+ ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..."
+ return 0
+ fi
+
+ default
+}
+
+src_install() {
+ default
+
+ if use perl ; then
+ exeinto /usr/bin
+ doexe src/strace-graph
+ fi
+
+ dodoc CREDITS
+}
diff --git a/dev-debug/strace/strace-6.6.ebuild b/dev-debug/strace/strace-6.6.ebuild
new file mode 100644
index 000000000000..482af8b00c17
--- /dev/null
+++ b/dev-debug/strace/strace-6.6.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic toolchain-funcs
+
+DESCRIPTION="Useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="https://strace.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/strace/strace.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="LGPL-2.1+ test? ( GPL-2+ )"
+SLOT="0"
+IUSE="aio perl selinux static test unwind elfutils"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( unwind elfutils )"
+
+BDEPEND="virtual/pkgconfig"
+LIB_DEPEND="
+ unwind? ( sys-libs/libunwind[static-libs(+)] )
+ elfutils? ( dev-libs/elfutils[static-libs(+)] )
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+"
+# strace only uses the header from libaio to decode structs
+DEPEND="
+ static? ( ${LIB_DEPEND} )
+ aio? ( >=dev-libs/libaio-0.3.106 )
+ sys-kernel/linux-headers
+"
+RDEPEND="
+ !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ perl? ( dev-lang/perl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.5-static.patch"
+)
+
+src_prepare() {
+ default
+
+ if [[ ! -e configure ]] ; then
+ # git generation
+ sed /autoreconf/d -i bootstrap || die
+ edo ./bootstrap
+ [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+ fi
+
+ eautoreconf
+
+ # Stub out the -k test since it's known to be flaky. bug #545812
+ sed -i '1iexit 77' tests*/strace-k.test || die
+}
+
+src_configure() {
+ # Set up the default build settings, and then use the names strace expects.
+ tc-export_build_env BUILD_{CC,CPP}
+ local v bv
+ for v in CC CPP {C,CPP,LD}FLAGS ; do
+ bv="BUILD_${v}"
+ export "${v}_FOR_BUILD=${!bv}"
+ done
+
+ filter-lfs-flags # configure handles this sanely
+
+ export ac_cv_header_libaio_h=$(usex aio)
+ use elibc_musl && export ac_cv_header_stdc=no
+
+ local myeconfargs=(
+ --disable-gcc-Werror
+
+ # Don't require mpers support on non-multilib systems. #649560
+ --enable-mpers=check
+
+ $(use_enable static)
+ $(use_with unwind libunwind)
+ $(use_with elfutils libdw)
+ $(use_with selinux libselinux)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ if has usersandbox ${FEATURES} ; then
+ # bug #643044
+ ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..."
+ return 0
+ fi
+
+ default
+}
+
+src_install() {
+ default
+
+ if use perl ; then
+ exeinto /usr/bin
+ doexe src/strace-graph
+ fi
+
+ dodoc CREDITS
+}
diff --git a/dev-debug/strace/strace-9999.ebuild b/dev-debug/strace/strace-9999.ebuild
new file mode 100644
index 000000000000..9c5835571a43
--- /dev/null
+++ b/dev-debug/strace/strace-9999.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic toolchain-funcs
+
+DESCRIPTION="Useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="https://strace.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/strace/strace.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="LGPL-2.1+ test? ( GPL-2+ )"
+SLOT="0"
+IUSE="aio perl selinux static test unwind elfutils"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( unwind elfutils )"
+
+BDEPEND="virtual/pkgconfig"
+LIB_DEPEND="
+ unwind? ( sys-libs/libunwind[static-libs(+)] )
+ elfutils? ( dev-libs/elfutils[static-libs(+)] )
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+"
+# strace only uses the header from libaio to decode structs
+DEPEND="
+ static? ( ${LIB_DEPEND} )
+ aio? ( >=dev-libs/libaio-0.3.106 )
+ sys-kernel/linux-headers
+"
+RDEPEND="
+ !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ perl? ( dev-lang/perl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.11-static.patch"
+)
+
+src_prepare() {
+ default
+
+ if [[ ! -e configure ]] ; then
+ # git generation
+ sed /autoreconf/d -i bootstrap || die
+ edo ./bootstrap
+ [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+ fi
+
+ eautoreconf
+
+ # Stub out the -k test since it's known to be flaky. bug #545812
+ sed -i '1iexit 77' tests*/strace-k.test || die
+}
+
+src_configure() {
+ # Set up the default build settings, and then use the names strace expects.
+ tc-export_build_env BUILD_{CC,CPP}
+ local v bv
+ for v in CC CPP {C,CPP,LD}FLAGS ; do
+ bv="BUILD_${v}"
+ export "${v}_FOR_BUILD=${!bv}"
+ done
+
+ filter-lfs-flags # configure handles this sanely
+
+ export ac_cv_header_libaio_h=$(usex aio)
+ use elibc_musl && export ac_cv_header_stdc=no
+
+ local myeconfargs=(
+ --disable-gcc-Werror
+
+ # Don't require mpers support on non-multilib systems. #649560
+ --enable-mpers=check
+
+ $(use_enable static)
+ $(use_with unwind libunwind)
+ $(use_with elfutils libdw)
+ $(use_with selinux libselinux)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ if has usersandbox ${FEATURES} ; then
+ # bug #643044
+ ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..."
+ return 0
+ fi
+
+ default
+}
+
+src_install() {
+ default
+
+ if use perl ; then
+ exeinto /usr/bin
+ doexe src/strace-graph
+ fi
+
+ dodoc CREDITS
+}