summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2021-11-04 15:48:26 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-15 11:56:16 +0000
commitd6768d9d52336094c4570395149c61bc26b9e3e1 (patch)
treef689598a83d3f0cd8ea7c12069454407c1280336 /meta
parent4aa48aeab8a28a962c09699f7b141e7c64d27ee9 (diff)
downloadpoky-d6768d9d52336094c4570395149c61bc26b9e3e1.tar.gz
strace: fix build against 5.15 kernel/kernel-headers
kernel 5.15 removed ipx.h from the uapi, but strace hasn't adjusted its tests to the removal. There is a WIP patch on the esyr/5.15 branch that solves the problem, so we grab it here, adjust for context and fix our build problem. When strace updates to 5.15, and we can bump our version and drop this patch. Upstream-Status: Backport [commit cca828197c0e16c2599129114] (From OE-Core rev: 1b47465688474cdba603578c1cbb768cfe699579) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a8c4ba727251e53494a4aec483fcc51982e6fb75) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/strace/strace/0001-Avoid-relying-on-presence-of-ipx.h.patch151
-rw-r--r--meta/recipes-devtools/strace/strace_5.14.bb1
2 files changed, 152 insertions, 0 deletions
diff --git a/meta/recipes-devtools/strace/strace/0001-Avoid-relying-on-presence-of-ipx.h.patch b/meta/recipes-devtools/strace/strace/0001-Avoid-relying-on-presence-of-ipx.h.patch
new file mode 100644
index 0000000000..6df673fa95
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/0001-Avoid-relying-on-presence-of-ipx.h.patch
@@ -0,0 +1,151 @@
1From 197f712ea96c12dcabc9fe98889a425d61ad6a60 Mon Sep 17 00:00:00 2001
2From: Eugene Syromyatnikov <evgsyr@gmail.com>
3Date: Wed, 3 Nov 2021 00:48:59 +0100
4Subject: [PATCH] Avoid relying on presence of ipx.h
5
6After Linux has broken UAPI in commit v5.15-rc1~157^2~207, it is well
7possible that neither kernel nor libc (such as musl, for example)
8provide IPX-related header. Avoid relying on its presence
9in the strace's code and conditionalise the relevant checks in the tests.
10
11* configure.ac (AC_CHECK_HEADERS): Add linux/ipx.h.
12* src/net.c: Remove <netipx/ipx.h>/<linux/ipx.h> includes.
13* src/sockaddr.c: Likewise.
14(IPX_NODE_LEN): New macro constant.
15(struct sockaddr_ipx): New type definition.
16* src/xlat/sock_ipx_options.in (IPX_TYPE): Provide a fallback value.
17* tests/net-sockaddr.c [!HAVE_LINUX_IPX_H]: Do not include
18<linux/ipx.h>.
19[!HAVE_LINUX_IPX_H && HAVE_NETIPX_IPX_H]: Include <netipx/ipx.h>.
20[!(HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H)]: Do not define
21check_ipx.
22[!(HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H)] (main): Do not call
23check_ipx.
24
25Closes: https://github.com/strace/strace/issues/201
26
27Upstream-Status: backport [commit cca828197c0e1 branch esyr/5.15]
28
29[bva: changed context to apply to a released strace 5.14 tarball]
30Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
31
32---
33 configure.ac | 1 +
34 src/net.c | 5 -----
35 src/sockaddr.c | 16 ++++++++++------
36 src/xlat/sock_ipx_options.in | 2 +-
37 tests/net-sockaddr.c | 10 +++++++++-
38 5 files changed, 21 insertions(+), 13 deletions(-)
39
40Index: strace-5.14/configure.ac
41===================================================================
42--- strace-5.14.orig/configure.ac
43+++ strace-5.14/configure.ac
44@@ -423,6 +423,7 @@
45 elf.h
46 gcov.h
47 iconv.h
48+ linux/ipx.h
49 mqueue.h
50 netinet/sctp.h
51 netipx/ipx.h
52Index: strace-5.14/src/net.c
53===================================================================
54--- strace-5.14.orig/src/net.c
55+++ strace-5.14/src/net.c
56@@ -28,11 +28,6 @@
57 #include <arpa/inet.h>
58 #include <net/if.h>
59 #include <asm/types.h>
60-#ifdef HAVE_NETIPX_IPX_H
61-# include <netipx/ipx.h>
62-#else
63-# include <linux/ipx.h>
64-#endif
65
66 #include <linux/ip_vs.h>
67 #include "netlink.h"
68Index: strace-5.14/src/sockaddr.c
69===================================================================
70--- strace-5.14.orig/src/sockaddr.c
71+++ strace-5.14/src/sockaddr.c
72@@ -24,12 +24,6 @@
73 #include <linux/if_ether.h>
74 #include <linux/x25.h>
75
76-#ifdef HAVE_NETIPX_IPX_H
77-# include <netipx/ipx.h>
78-#else
79-# include <linux/ipx.h>
80-#endif
81-
82 #include "xlat/addrfams.h"
83 #include "xlat/arp_hardware_types.h"
84 #include "xlat/ethernet_protocols.h"
85@@ -45,6 +39,16 @@
86 const size_t arp_hardware_types_size = ARRAY_SIZE(arp_hardware_types) - 1;
87 const size_t ethernet_protocols_size = ARRAY_SIZE(ethernet_protocols) - 1;
88
89+#define IPX_NODE_LEN 6
90+struct sockaddr_ipx {
91+ uint16_t sipx_family;
92+ uint16_t sipx_port;
93+ uint32_t sipx_network;
94+ unsigned char sipx_node[IPX_NODE_LEN];
95+ uint8_t sipx_type;
96+ unsigned char sipx_zero;
97+};
98+
99 static void
100 print_sockaddr_data_un(struct tcb *tcp, const void *const buf, const int addrlen)
101 {
102Index: strace-5.14/src/xlat/sock_ipx_options.in
103===================================================================
104--- strace-5.14.orig/src/xlat/sock_ipx_options.in
105+++ strace-5.14/src/xlat/sock_ipx_options.in
106@@ -1 +1 @@
107-IPX_TYPE
108+IPX_TYPE 1
109Index: strace-5.14/tests/net-sockaddr.c
110===================================================================
111--- strace-5.14.orig/tests/net-sockaddr.c
112+++ strace-5.14/tests/net-sockaddr.c
113@@ -24,7 +24,11 @@
114 #include <linux/if_ether.h>
115 #include <linux/if_packet.h>
116 #include <linux/x25.h>
117-#include <linux/ipx.h>
118+#if defined HAVE_LINUX_IPX_H
119+# include <linux/ipx.h>
120+#elif defined HAVE_NETIPX_IPX_H
121+# include <netipx/ipx.h>
122+#endif
123 #ifdef HAVE_BLUETOOTH_BLUETOOTH_H
124 # include <bluetooth/bluetooth.h>
125 # include <bluetooth/hci.h>
126@@ -269,6 +273,7 @@
127 printf("connect(-1, %p, %u) = %d EBADF (%m)\n", in6, len, ret);
128 }
129
130+#if defined HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H
131 static void
132 check_ipx(void)
133 {
134@@ -295,6 +300,7 @@
135 c_ipx.sipx_node[4], c_ipx.sipx_node[5],
136 c_ipx.sipx_type, len, ret);
137 }
138+#endif /* HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H */
139
140 /* for a bit more compact AX.25 address definitions */
141 #define AX25_ADDR(c_, s_) \
142@@ -773,7 +779,9 @@
143 check_un();
144 check_in();
145 check_in6();
146+#if defined HAVE_LINUX_IPX_H || defined HAVE_NETIPX_IPX_H
147 check_ipx();
148+#endif
149 check_ax25();
150 check_x25();
151 check_nl();
diff --git a/meta/recipes-devtools/strace/strace_5.14.bb b/meta/recipes-devtools/strace/strace_5.14.bb
index 02a4843edf..3229954b3f 100644
--- a/meta/recipes-devtools/strace/strace_5.14.bb
+++ b/meta/recipes-devtools/strace/strace_5.14.bb
@@ -14,6 +14,7 @@ SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
14 file://ptest-spacesave.patch \ 14 file://ptest-spacesave.patch \
15 file://uintptr_t.patch \ 15 file://uintptr_t.patch \
16 file://0001-strace-fix-reproducibilty-issues.patch \ 16 file://0001-strace-fix-reproducibilty-issues.patch \
17 file://0001-Avoid-relying-on-presence-of-ipx.h.patch \
17 " 18 "
18SRC_URI[sha256sum] = "901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73" 19SRC_URI[sha256sum] = "901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73"
19 20