diff --git a/main/strace/APKBUILD b/main/strace/APKBUILD index e47a28d588ba50ff4065d3903d5f207f604b0819..b14b6a4200ea59019435b4b186d23ba8403d8257 100644 --- a/main/strace/APKBUILD +++ b/main/strace/APKBUILD @@ -1,18 +1,20 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=strace -pkgver=6.11 +pkgver=6.12 pkgrel=0 pkgdesc="Diagnostic, debugging and instructional userspace tracer" url="https://strace.io" arch="all" -# disable checks for now, due to testsuite failure +# checks fail on CI options="!check" license="BSD-3-Clause" # strace with libunwind doesn't work right on musl makedepends="binutils-dev elfutils-dev gawk linux-headers" -subpackages="$pkgname-doc" +subpackages="$pkgname-doc $pkgname-dbg" source="https://github.com/strace/strace/releases/download/v$pkgver/strace-$pkgver.tar.xz - disable-fortify.patch + off64.patch + busybox.patch + tv_usec.patch nlattr-fix.patch " @@ -26,11 +28,16 @@ build() { --mandir=/usr/share/man \ --localstatedir=/var \ --enable-mpers=no + # FIXME don't use bundled kernel headers + # --enable-bundled=no make } check() { - make check + make check || { + cat tests/test-suite.log + return 1 + } } package() { @@ -38,7 +45,9 @@ package() { } sha512sums=" -c639ae7097d418f8b815bd008de9423079dad70829a5eb392d3c5def81243b8a9133c10251a7c00a4991f580cff5b62466f8b53b4b8e425a009548fb3582bdb0 strace-6.11.tar.xz -273b92ebf0069f19bef7ec26c7860e2af7ef01e782255c70ded1ae5e967f8f6bf031ecba96612c6083bf58f46278ba4ab3ec0fb35b08c8c8d668191f97adee52 disable-fortify.patch +ae28f0b6b6fdc980898f11d1903aacb5a31760a07d63bd7cbc8f9b5f337d9db6b40464d6b61a9b03ba6442b476edb78afc91348f539f7780cdd98b174c6a9a1d strace-6.12.tar.xz +b2e7a5cedfef8128e5a3d9aed8fce606936e70a7d574196bd8ad797966be3b1eac6f3390d7a59f28d349d35e7f5abe6591a28749ec1f063a2133f138ff9c656c off64.patch +c32850f4a3d4650850a6362b0ac437a175df263c8762cf0310df0ba8d8d20f0dd05d34f2b01891354e457752e49d82a1fe873754f703608a5e3202234d7bc9e6 busybox.patch +84c345cb04a68b96487f9cfc0c31243d22eab6e83dbee79b749d165b81489671b5701ae2cb8da0d93f5dd6cf2c2402693336869ad671d991870baaab9a99a6a1 tv_usec.patch 44b1872cf996caa4970fa6c2875a3a2cffe4a38455e328d968bd7855ef9a05cf41190794dc137bc8667576635f5271057cf0e6cde9a6c7aee66afd1dba9bdba0 nlattr-fix.patch " diff --git a/main/strace/busybox.patch b/main/strace/busybox.patch new file mode 100644 index 0000000000000000000000000000000000000000..df250aa2c901f75c1dd330f603cde00435c1c9fa --- /dev/null +++ b/main/strace/busybox.patch @@ -0,0 +1,33 @@ +Fixes for busybox + +--- a/tests/status-detached.expected ++++ b/tests/status-detached.expected +@@ -1 +1 @@ +-nanosleep\({tv_sec=2, tv_nsec=0}, <detached \.\.\.> ++nanosleep\(\{tv_sec=2, tv_nsec=0\}, <detached \.\.\.> +--- a/tests/strace--tips.test ++++ b/tests/strace--tips.test +@@ -13,7 +13,7 @@ tips_fmt_opt="" + + grep_ere_escape() + { +- printf "%s" "$*" | sed 's/[].*&^$()|[\/]/\\&/g' ++ printf "%s" "$*" | sed 's/[].*&^$(){}|[\\/]/\\&/g' + } + + # Check that simple "strace --tips=0" works as expected +--- a/tests/strace-k.test ++++ b/tests/strace-k.test +@@ -26,10 +26,9 @@ check_prog sed + check_prog tr + + path_to_sed="$(command -v sed)" +-if [ -x "$path_to_sed" ] && +- path_to_sed="$(readlink -ev -- "$path_to_sed")"; then ++if [ -x "$path_to_sed" ]; then + "$path_to_sed" -n 's/^[^/]\+[[:space:]]\(\/.*\)$/\1/p' /proc/self/maps | +- grep -F -x -e "$path_to_sed" > /dev/null || { ++ grep -F -x -e "$(readlink -fv -- "$path_to_sed")" > /dev/null || { + cat >&2 /proc/self/maps + framework_skip_ '/proc/self/maps is invalid' + } diff --git a/main/strace/disable-fortify.patch b/main/strace/disable-fortify.patch deleted file mode 100644 index 26b2978c5a854f53c6d6af8a05fa0b6f93326e6c..0000000000000000000000000000000000000000 --- a/main/strace/disable-fortify.patch +++ /dev/null @@ -1,39 +0,0 @@ -Subject: [PATCH] don't use fortify-headers on netlink test sources -From: A. Wilcox <AWilcox@Wilcox-Tech.com> - -We can't use fortify-headers on netlink tests because it tests what happens -when a buffer overrun occurs. - ---- strace-4.18/tests/netlink_protocol.c.old 2017-07-05 07:08:09.000000000 +0000 -+++ strace-4.18/tests/netlink_protocol.c 2017-08-17 01:09:45.822502012 +0000 -@@ -28,6 +28,8 @@ - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#define _FORTIFY_SOURCE 0 -+ - #include "tests.h" - - #ifdef HAVE_SYS_XATTR_H ---- strace-4.18/tests/netlink_sock_diag.c.old 2017-07-05 07:08:09.000000000 +0000 -+++ strace-4.18/tests/netlink_sock_diag.c 2017-08-17 01:10:00.935807300 +0000 -@@ -27,6 +27,8 @@ - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#define _FORTIFY_SOURCE 0 -+ - #include "tests.h" - #include <stdio.h> - #include <string.h> ---- strace-4.18/tests/nlattr.c.old 2017-07-05 07:08:09.000000000 +0000 -+++ strace-4.18/tests/nlattr.c 2017-08-17 01:10:11.862453682 +0000 -@@ -28,6 +28,8 @@ - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -+#define _FORTIFY_SOURCE 0 -+ - #include "tests.h" - - #include <stdio.h> diff --git a/main/strace/off64.patch b/main/strace/off64.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ac41c3502fceed709c1e84b235920655bd452cf --- /dev/null +++ b/main/strace/off64.patch @@ -0,0 +1,39 @@ +off_t is always 64-bit with musl + +--- a/tests/readahead.c ++++ b/tests/readahead.c +@@ -42,7 +42,7 @@ static const int fds[] = { + 0x7fffffff, + }; + +-static const off64_t offsets[] = { ++static const off_t offsets[] = { + -0x8000000000000000LL, + -0x5060708090a0b0c0LL, + -1LL, +--- a/tests/sync_file_range.c ++++ b/tests/sync_file_range.c +@@ -20,8 +20,8 @@ int + main(void) + { + const int fd = -1; +- const off64_t offset = 0xdeadbeefbadc0dedULL; +- const off64_t nbytes = 0xfacefeedcafef00dULL; ++ const off_t offset = 0xdeadbeefbadc0dedULL; ++ const off_t nbytes = 0xfacefeedcafef00dULL; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); +--- a/tests/sync_file_range2.c ++++ b/tests/sync_file_range2.c +@@ -20,8 +20,8 @@ int + main(void) + { + const int fd = -1; +- const off64_t offset = 0xdeadbeefbadc0ded; +- const off64_t nbytes = 0xfacefeedcafef00d; ++ const off_t offset = 0xdeadbeefbadc0ded; ++ const off_t nbytes = 0xfacefeedcafef00d; + const unsigned int flags = -1; + + int rc = sync_file_range(fd, offset, nbytes, flags); diff --git a/main/strace/tv_usec.patch b/main/strace/tv_usec.patch new file mode 100644 index 0000000000000000000000000000000000000000..51b307307ab3fe815e8186f92807d76a64b78141 --- /dev/null +++ b/main/strace/tv_usec.patch @@ -0,0 +1,46 @@ +Fix types on 32-bit + +--- a/tests/futimesat.c ++++ b/tests/futimesat.c +@@ -100,7 +100,7 @@ main(void) + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (typeof(tv[1].tv_sec)) 0xcafef00ddeadbeefLL; +- tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; ++ tv[1].tv_usec = (typeof(tv[1].tv_usec)) 0xbadc0dedfacefeedLL; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); +--- a/tests/xettimeofday.c ++++ b/tests/xettimeofday.c +@@ -58,7 +58,7 @@ main(void) + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); + + tv->tv_sec = (typeof(tv->tv_sec)) 0xcafef00ddeadbeefLL; +- tv->tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; ++ tv->tv_usec = (typeof(tv->tv_usec)) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", +--- a/tests/xselect.c ++++ b/tests/xselect.c +@@ -214,7 +214,7 @@ main(void) + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = (typeof(tv_in.tv_sec)) 0xcafef00ddeadbeefLL; +- tv_in.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; ++ tv_in.tv_usec = (typeof(tv_in.tv_usec)) 0xbadc0dedfacefeedLL; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +--- a/tests/xutimes.c ++++ b/tests/xutimes.c +@@ -87,7 +87,7 @@ main(void) + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (typeof(tv[1].tv_sec)) 0xcafef00ddeadbeefLL; +- tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; ++ tv[1].tv_usec = (typeof(tv[1].tv_usec)) 0xbadc0dedfacefeedLL; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname);