Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/stress-ng: fix uclibc-ng build
@ 2024-05-04  8:20 Fabrice Fontaine
  2024-05-05 17:41 ` Yann E. MORIN
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2024-05-04  8:20 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Fabrice Fontaine

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 <fontaine.fabrice@gmail.com>
---
 ...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..88fef900e7
--- /dev/null
+++ b/package/stress-ng/0001-stress-sock.c-fix-build-without-SO_ZEROCOPY.patch
@@ -0,0 +1,56 @@
+From 6a719f95e0547a6dfaa9178b42c2a5dbd931ce1a Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+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 <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/ColinIanKing/stress-ng/pull/381
+---
+ 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
+
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/1] package/stress-ng: fix uclibc-ng build
@ 2024-05-08 20:11 Fabrice Fontaine
  2024-05-09 14:32 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2024-05-08 20:11 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Fabrice Fontaine

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/e75ecbc8994e94b9e151b1191c1888bd2821fe72:

In file included from core-sched.c:25:
core-sched.c: In function 'stress_set_sched':
core-sched.c:170:22: error: 'struct shim_sched_attr' has no member named '__sched_priority'; did you mean 'sched_priority'?
  170 |                 attr.sched_priority = (unsigned int)sched_priority;
      |                      ^~~~~~~~~~~~~~

Fixes: 6fb179b906a1755d77bda9e501c5335ac163f3cb
 - http://autobuild.buildroot.org/results/d7d38dbb10f7f188da8dccc44a84a3c46a720bed

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...002-core-sched.c-fix-uclibc-ng-build.patch | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 package/stress-ng/0002-core-sched.c-fix-uclibc-ng-build.patch

diff --git a/package/stress-ng/0002-core-sched.c-fix-uclibc-ng-build.patch b/package/stress-ng/0002-core-sched.c-fix-uclibc-ng-build.patch
new file mode 100644
index 0000000000..c9c4e22603
--- /dev/null
+++ b/package/stress-ng/0002-core-sched.c-fix-uclibc-ng-build.patch
@@ -0,0 +1,40 @@
+From f8dc9f790251562c3a4635edd29d7674298cd5f7 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 4 May 2024 17:52:32 +0200
+Subject: [PATCH] core-sched.c: fix uclibc-ng build
+
+Since version 0.17.02 and commit
+e75ecbc8994e94b9e151b1191c1888bd2821fe72, sched.h is not included before
+including core-shim.h. The issue is that core-shim.h defines its own
+sched_priority parameter in shim_sched_attr. When sched.h is included
+after core-shim.h, the build will fail because __sched_priority will not
+be found:
+
+In file included from core-sched.c:25:
+core-sched.c: In function 'stress_set_sched':
+core-sched.c:170:22: error: 'struct shim_sched_attr' has no member named '__sched_priority'; did you mean 'sched_priority'?
+  170 |                 attr.sched_priority = (unsigned int)sched_priority;
+      |                      ^~~~~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/d7d38dbb10f7f188da8dccc44a84a3c46a720bed
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/ColinIanKing/stress-ng/commit/f8dc9f790251562c3a4635edd29d7674298cd5f7
+---
+ core-shim.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/core-shim.h b/core-shim.h
+index bed4cf2f6..475aac512 100644
+--- a/core-shim.h
++++ b/core-shim.h
+@@ -23,6 +23,8 @@
+ #include <sys/uio.h>
+ #endif
+ 
++#include <sched.h>
++
+ /*
+  *  BeagleBoneBlack with 4.1.15 kernel does not
+  *  define the following, these should be defined
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-09 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-04  8:20 [Buildroot] [PATCH 1/1] package/stress-ng: fix uclibc-ng build Fabrice Fontaine
2024-05-05 17:41 ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2024-05-08 20:11 Fabrice Fontaine
2024-05-09 14:32 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox