From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 271C8158086 for ; Fri, 10 Dec 2021 01:24:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B972B2BC01F; Fri, 10 Dec 2021 01:24:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5FCB12BC031 for ; Fri, 10 Dec 2021 01:24:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 72EBD343891 for ; Fri, 10 Dec 2021 01:24:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ADD2F1F2 for ; Fri, 10 Dec 2021 01:24:52 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1639099452.31425f1d937b44a5dabb5e37073ff5f94e5edc3e.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/strace/files/, dev-util/strace/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/strace/files/strace-5.12-detect-ipx-presence.patch dev-util/strace/strace-5.12-r1.ebuild dev-util/strace/strace-5.14-r1.ebuild X-VCS-Directories: dev-util/strace/files/ dev-util/strace/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 31425f1d937b44a5dabb5e37073ff5f94e5edc3e X-VCS-Branch: master Date: Fri, 10 Dec 2021 01:24:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1a0f1eb4-f7dd-4c5c-89c0-6ff42b061882 X-Archives-Hash: 8ce4bde01d209a709afbef4742a9685c commit: 31425f1d937b44a5dabb5e37073ff5f94e5edc3e Author: Petr Vaněk atlas cz> AuthorDate: Thu Dec 9 10:54:41 2021 +0000 Commit: Sam James gentoo org> CommitDate: Fri Dec 10 01:24:12 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31425f1d dev-util/strace: Fix build on systems without ipx.h Strace 5.12 and 5.14 fails to build on systems with missing ipx.h (combination of kernel 5.15 and musl libc). The problem is already fixed in upstream commit 568ee52f885c ("Avoid relying on presence of ipx.h"), which is present in 5.15 release. This change backports it to both broken versions. Upstream-issue: https://github.com/strace/strace/issues/201 Signed-off-by: Petr Vaněk atlas.cz> Closes: https://github.com/gentoo/gentoo/pull/23232 Signed-off-by: Sam James gentoo.org> .../files/strace-5.12-detect-ipx-presence.patch | 141 +++++++++++++++++++++ dev-util/strace/strace-5.12-r1.ebuild | 1 + dev-util/strace/strace-5.14-r1.ebuild | 1 + 3 files changed, 143 insertions(+) diff --git a/dev-util/strace/files/strace-5.12-detect-ipx-presence.patch b/dev-util/strace/files/strace-5.12-detect-ipx-presence.patch new file mode 100644 index 000000000000..37bab4399329 --- /dev/null +++ b/dev-util/strace/files/strace-5.12-detect-ipx-presence.patch @@ -0,0 +1,141 @@ +From: Eugene Syromyatnikov +Date: Wed, 3 Nov 2021 00:48:59 +0100 +Subject: [PATCH] Avoid relying on presence of ipx.h + +After Linux has broken UAPI in commit v5.15-rc1~157^2~207, it is well +possible that neither kernel nor libc (such as musl, for example) +provides an IPX-related header. Avoid relying on its presence +in the strace's code and conditionalise the relevant checks in the tests. + +* configure.ac (AC_CHECK_HEADERS): Add linux/ipx.h. +* src/net.c: Remove / includes. +* src/sockaddr.c: Likewise. +(IPX_NODE_LEN): New macro constant. +(struct sockaddr_ipx): New type definition. +* src/xlat/sock_ipx_options.in (IPX_TYPE): Provide a fallback value. +* tests/net-sockaddr.c [!HAVE_LINUX_IPX_H]: Do not include +. +[!HAVE_LINUX_IPX_H && HAVE_NETIPX_IPX_H]: Include . +[!(HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H)] (check_ipx): Do not +define. +(main) [!(HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H)]: Do not call +check_ipx. + +Closes: https://github.com/strace/strace/issues/201 +--- + +diff --git a/configure.ac b/configure.ac +index 2771c0f82..3c7fcb91e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -423,6 +423,7 @@ AC_CHECK_HEADERS(m4_normalize([ + elf.h + gcov.h + iconv.h ++ linux/ipx.h + mqueue.h + netinet/sctp.h + netipx/ipx.h +diff --git a/src/net.c b/src/net.c +index b23911a97..bbc52e15f 100644 +--- a/src/net.c ++++ b/src/net.c +@@ -28,11 +28,6 @@ + #include + #include + #include +-#ifdef HAVE_NETIPX_IPX_H +-# include +-#else +-# include +-#endif + + #include + #include "netlink.h" +diff --git a/src/sockaddr.c b/src/sockaddr.c +index 8b2b0afaf..e1dc09b71 100644 +--- a/src/sockaddr.c ++++ b/src/sockaddr.c +@@ -24,12 +24,6 @@ + #include + #include + +-#ifdef HAVE_NETIPX_IPX_H +-# include +-#else +-# include +-#endif +- + #include "xlat/addrfams.h" + #include "xlat/arp_hardware_types.h" + #include "xlat/ethernet_protocols.h" +@@ -45,6 +39,16 @@ + const size_t arp_hardware_types_size = ARRAY_SIZE(arp_hardware_types) - 1; + const size_t ethernet_protocols_size = ARRAY_SIZE(ethernet_protocols) - 1; + ++#define IPX_NODE_LEN 6 ++struct sockaddr_ipx { ++ uint16_t sipx_family; ++ uint16_t sipx_port; ++ uint32_t sipx_network; ++ unsigned char sipx_node[IPX_NODE_LEN]; ++ uint8_t sipx_type; ++ unsigned char sipx_zero; ++}; ++ + static void + print_sockaddr_data_un(struct tcb *tcp, const void *const buf, const int addrlen) + { +diff --git a/src/xlat/sock_ipx_options.in b/src/xlat/sock_ipx_options.in +index eba97fd71..b09be117e 100644 +--- a/src/xlat/sock_ipx_options.in ++++ b/src/xlat/sock_ipx_options.in +@@ -1 +1 @@ +-IPX_TYPE ++IPX_TYPE 1 +diff --git a/tests/net-sockaddr.c b/tests/net-sockaddr.c +index f1f9b01cd..c8049fd68 100644 +--- a/tests/net-sockaddr.c ++++ b/tests/net-sockaddr.c +@@ -24,7 +24,11 @@ + #include + #include + #include +-#include ++#if defined HAVE_LINUX_IPX_H ++# include ++#elif defined HAVE_NETIPX_IPX_H ++# include ++#endif + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + # include + # include +@@ -269,6 +273,7 @@ check_in6(void) + printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in6, len, ret); + } + ++#if defined HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H + static void + check_ipx(void) + { +@@ -295,6 +300,7 @@ check_ipx(void) + c_ipx.sipx_node[4], c_ipx.sipx_node[5], + c_ipx.sipx_type, len, ret); + } ++#endif /* HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H */ + + /* for a bit more compact AX.25 address definitions */ + #define AX25_ADDR(c_, s_) \ +@@ -773,7 +779,9 @@ main(void) + check_un(); + check_in(); + check_in6(); ++#if defined HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H + check_ipx(); ++#endif + check_ax25(); + check_x25(); + check_nl(); +-- +2.32.0 + diff --git a/dev-util/strace/strace-5.12-r1.ebuild b/dev-util/strace/strace-5.12-r1.ebuild index 98210d8944bf..d6e2d267ba84 100644 --- a/dev-util/strace/strace-5.12-r1.ebuild +++ b/dev-util/strace/strace-5.12-r1.ebuild @@ -43,6 +43,7 @@ RDEPEND=" PATCHES=( "${FILESDIR}/${PN}-5.11-static.patch" + "${FILESDIR}/${PN}-5.12-detect-ipx-presence.patch" ) src_prepare() { diff --git a/dev-util/strace/strace-5.14-r1.ebuild b/dev-util/strace/strace-5.14-r1.ebuild index 98210d8944bf..d6e2d267ba84 100644 --- a/dev-util/strace/strace-5.14-r1.ebuild +++ b/dev-util/strace/strace-5.14-r1.ebuild @@ -43,6 +43,7 @@ RDEPEND=" PATCHES=( "${FILESDIR}/${PN}-5.11-static.patch" + "${FILESDIR}/${PN}-5.12-detect-ipx-presence.patch" ) src_prepare() {