iperf2: Add _GNU_SOURCE define to cflags on musl
PATCH 1/1 iperf2: Add _GNU_SOURCE define to cflags on musl
glibc defines struct udphdr as a union where members have aliased names
uh_sport -> sourceuh_dport -> uh_dportuh_dport -> len
check -> check
But musl only defines the aliases if _GNU_SOURCE is defined, ideally iperf2 should be using uh_* names of the members so it is portable across musl and glibc but thats for upstream to consider.
Fixes
| ../../iperf-2.2.1/src/checksums.c:175:19: error: no member named 'check' in 'struct udphdr'
| 175 | if (!udp_hdr->check) {
| | ~~~~~~~ ^
| 1 error generated.
| make[2]: *** [Makefile:539: checksums.o] Error 1Signed-off-by Khem Raj <[email protected]>
Cc Randy MacLeod <[email protected]>
--- meta-oe/recipes-benchmark/iperf2/iperf2_2.2.1.bb | 2 ++ 1 file changed, 2 insertions(+)
meta-oe/recipes-benchmark/iperf2/iperf2_2.2.1.bb +2 -0
@@ -15,6 +15,8 @@ inherit autotools pkgconfig EXTRA_OECONF = "--exec-prefix=${STAGING_DIR_HOST}${layout_exec_prefix}" +CFLAGS:append:libc-musl = " -D_GNU_SOURCE" + PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}" PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"