All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/iperf: bump to version 2.2.1
@ 2024-11-11 12:16 Julien Olivain
  2024-11-11 20:28 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2024-11-11 12:16 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain

For release note, see after the file list at:
https://sourceforge.net/projects/iperf2/files/

This commit also adds a package patch to fix the build with musl
libc toolchains.

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
Patch tested in:
https://gitlab.com/jolivain/buildroot/-/pipelines/1536373099
---
 ...cksums.c-needs-to-define-_GNU_SOURCE.patch | 53 +++++++++++++++++++
 package/iperf/iperf.hash                      |  6 +--
 package/iperf/iperf.mk                        |  2 +-
 3 files changed, 57 insertions(+), 4 deletions(-)
 create mode 100644 package/iperf/0001-checksums.c-needs-to-define-_GNU_SOURCE.patch

diff --git a/package/iperf/0001-checksums.c-needs-to-define-_GNU_SOURCE.patch b/package/iperf/0001-checksums.c-needs-to-define-_GNU_SOURCE.patch
new file mode 100644
index 0000000000..5233be0f7c
--- /dev/null
+++ b/package/iperf/0001-checksums.c-needs-to-define-_GNU_SOURCE.patch
@@ -0,0 +1,53 @@
+From 3ac9376c2bc67433b9cd21e7d7650c1c7e939bcc Mon Sep 17 00:00:00 2001
+From: Julien Olivain <ju.o@free.fr>
+Date: Mon, 11 Nov 2024 11:41:28 +0100
+Subject: [PATCH] checksums.c needs to define _GNU_SOURCE
+
+When compiling with musl libc [1], iperf2 fail to build with error:
+
+    checksums.c: In function 'udpchecksum':
+    checksums.c:175:17: error: 'const struct udphdr' has no member named 'check'
+      175 |     if (!udp_hdr->check) {
+          |                 ^~
+
+This failure was introduced in commit [2], in version 2.2.1. This is
+due to the switch from using <linux/udp.h> (which always define "struct
+udphdr" members), to <netinet/udp.h> which define members in musl libc
+only when _GNU_SOURCE is defined. See [3].
+
+Note: those use of udphdr members in checksums.c were introduced in
+commit [4], in version 2.1.1.
+
+This commit fixes the issue by defining _GNU_SOURCE in checksums.c.
+
+This issue was found in the iperf integration in Buildroot Linux [5].
+
+[1] https://www.musl-libc.org/
+[2] https://sourceforge.net/p/iperf2/code/ci/2a5fe6ffd4519ef3c6fc95704096646f897bd124/
+[3] https://git.musl-libc.org/cgit/musl/tree/include/netinet/udp.h?h=v1.2.5#n11
+[4] https://sourceforge.net/p/iperf2/code/ci/2ba97baecb4930e373ee5f51fc84115246e85096/
+[5] https://buildroot.org/
+
+Upstream: https://sourceforge.net/p/iperf2/tickets/342/
+Signed-off-by: Julien Olivain <ju.o@free.fr>
+---
+ src/checksums.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/checksums.c b/src/checksums.c
+index 852f1952..d7a8109e 100644
+--- a/src/checksums.c
++++ b/src/checksums.c
+@@ -47,6 +47,9 @@
+  * by Robert J. McMahon (rjmcmahon@rjmcmahon.com, bob.mcmahon@broadcom.com)
+  * -------------------------------------------------------------------
+  */
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
+ #include "headers.h"
+ 
+ /*
+-- 
+2.47.0
+
diff --git a/package/iperf/iperf.hash b/package/iperf/iperf.hash
index e4d40d5940..626f23f387 100644
--- a/package/iperf/iperf.hash
+++ b/package/iperf/iperf.hash
@@ -1,7 +1,7 @@
 # From https://sourceforge.net/projects/iperf2/files/
-md5  34bb6ac1abeb801bf3f729794dc5ac36  iperf-2.2.0.tar.gz
-sha1  bcbd101ab36f3faacaab1a765a96806ca49a1495  iperf-2.2.0.tar.gz
+md5  dc7ef2413a09b619e52cad199ad038ba  iperf-2.2.1.tar.gz
+sha1  9b30b1f3140d4f714555fee5ed21aa2bf4046aee  iperf-2.2.1.tar.gz
 
 # Locally computed:
-sha256  16810a9575e4c6dd65e4a18ab5df3cdac6730b3c832cf080a8990f132f68364a  iperf-2.2.0.tar.gz
+sha256  754ab0a7e28033dbea81308ef424bc7df4d6e2fe31b60cc536b61b51fefbd8fb  iperf-2.2.1.tar.gz
 sha256  5f9f5c4feca3347c3b3c0ada8b16b4e6b698aac4e6f016a24adf61a5915336d1  COPYING
diff --git a/package/iperf/iperf.mk b/package/iperf/iperf.mk
index 303614668a..62ed9d6e5f 100644
--- a/package/iperf/iperf.mk
+++ b/package/iperf/iperf.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-IPERF_VERSION = 2.2.0
+IPERF_VERSION = 2.2.1
 IPERF_SITE = https://downloads.sourceforge.net/project/iperf2
 IPERF_LICENSE = MIT-like
 IPERF_LICENSE_FILES = COPYING
-- 
2.47.0

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

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

end of thread, other threads:[~2024-11-11 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 12:16 [Buildroot] [PATCH 1/1] package/iperf: bump to version 2.2.1 Julien Olivain
2024-11-11 20:28 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.