From 66ebbebdb4dc7bc56339e0a1f1cb8d2e8e30c2f2 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sat, 4 May 2024 10:20:14 +0200 Subject: [PATCH] package/stress-ng: fix uclibc-ng build Fix the following uclibc-ng build failure raised since bump to version 0.17.07 in commit 6fb179b906a1755d77bda9e501c5335ac163f3cb and https://github.com/ColinIanKing/stress-ng/commit/2ad8aff9bc1ab822cf615c72712c6031a8f60bbd: stress-sock.c: In function 'stress_sock_client': stress-sock.c:656:35: error: 'SO_ZEROCOPY' undeclared (first use in this function); did you mean 'MSG_ZEROCOPY'? 656 | if (setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &so_zerocopy, sizeof(so_zerocopy)) == 0) { | ^~~~~~~~~~~ | MSG_ZEROCOPY stress-sock.c:656:35: note: each undeclared identifier is reported only once for each function it appears in CC stress-sockfd.c stress-sock.c: In function 'stress_sock_server': stress-sock.c:1060:34: error: 'SO_ZEROCOPY' undeclared (first use in this function); did you mean 'MSG_ZEROCOPY'? 1060 | if (setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &so_zerocopy, sizeof(so_zerocopy)) == 0) { | ^~~~~~~~~~~ | MSG_ZEROCOPY Fixes: 6fb179b906a1755d77bda9e501c5335ac163f3cb - http://autobuild.buildroot.org/results/bcff31bd9820cf0b95f8d8c6de44fd4ab8e2f065 Signed-off-by: Fabrice Fontaine [yann.morin.1998@free.fr: reference upstream commit now it's merged] Signed-off-by: Yann E. MORIN --- ...sock.c-fix-build-without-SO_ZEROCOPY.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 package/stress-ng/0001-stress-sock.c-fix-build-without-SO_ZEROCOPY.patch diff --git a/package/stress-ng/0001-stress-sock.c-fix-build-without-SO_ZEROCOPY.patch b/package/stress-ng/0001-stress-sock.c-fix-build-without-SO_ZEROCOPY.patch new file mode 100644 index 0000000000..f1f4ab5636 --- /dev/null +++ b/package/stress-ng/0001-stress-sock.c-fix-build-without-SO_ZEROCOPY.patch @@ -0,0 +1,56 @@ +From 142c3b2414f0adfb13b59dea993054a0daa6cd52 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 4 May 2024 10:04:20 +0200 +Subject: [PATCH] stress-sock.c: fix build without SO_ZEROCOPY + +uclibc-ng defines MSG_ZEROCOPY but not SO_ZEROCOPY resulting in the +following build failure since version 0.17.04 and +https://github.com/ColinIanKing/stress-ng/commit/2ad8aff9bc1ab822cf615c72712c6031a8f60bbd: + +stress-sock.c: In function 'stress_sock_client': +stress-sock.c:656:35: error: 'SO_ZEROCOPY' undeclared (first use in this function); did you mean 'MSG_ZEROCOPY'? + 656 | if (setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &so_zerocopy, sizeof(so_zerocopy)) == 0) { + | ^~~~~~~~~~~ + | MSG_ZEROCOPY +stress-sock.c:656:35: note: each undeclared identifier is reported only once for each function it appears in +CC stress-sockfd.c +stress-sock.c: In function 'stress_sock_server': +stress-sock.c:1060:34: error: 'SO_ZEROCOPY' undeclared (first use in this function); did you mean 'MSG_ZEROCOPY'? + 1060 | if (setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &so_zerocopy, sizeof(so_zerocopy)) == 0) { + | ^~~~~~~~~~~ + | MSG_ZEROCOPY + +Fixes: + - http://autobuild.buildroot.org/results/bcff31bd9820cf0b95f8d8c6de44fd4ab8e2f065 + +Signed-off-by: Fabrice Fontaine +Upstream: https://github.com/ColinIanKing/stress-ng/commit/142c3b2414f0adfb13b59dea993054a0daa6cd52 +--- + stress-sock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/stress-sock.c b/stress-sock.c +index 253730168..880530d04 100644 +--- a/stress-sock.c ++++ b/stress-sock.c +@@ -649,7 +649,7 @@ retry: + args->name, errno, strerror(errno)); + goto free_controls; + } +-#if defined(MSG_ZEROCOPY) ++#if defined(MSG_ZEROCOPY) && defined(SO_ZEROCOPY) + if (sock_zerocopy) { + int so_zerocopy = 1; + +@@ -1053,7 +1053,7 @@ static int OPTIMIZE3 stress_sock_server( + goto die; + } + +-#if defined(MSG_ZEROCOPY) ++#if defined(MSG_ZEROCOPY) && defined(SO_ZEROCOPY) + if (sock_zerocopy) { + int so_zerocopy = 1; + +-- +2.43.0 +