musl build failure due to tuntap since version 2.1.4
A means to measure network responsiveness and throughput
Brought to you by:
rjmcmahon
The build of iperf fails on musl since at least version 2.1.4 and https://sourceforge.net/p/iperf2/code/ci/b81ab0f1efdbe693ab485b2500ddd71e1e1ce453:
In file included from /home/giuliobenetti/autobuild/run/instance-0/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/net/ethernet.h:10,
from ../include/headers.h:117,
from Thread.c:72:
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/netinet/if_ether.h:116:8: error: redefinition of 'struct ethhdr'
116 | struct ethhdr {
| ^~~~~~
In file included from /home/giuliobenetti/autobuild/run/instance-0/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/if_tun.h:20,
from ../include/headers.h:110,
from Thread.c:72:
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/linux/if_ether.h:148:8: note: originally defined here
148 | struct ethhdr {
| ^~~~~~
The build could be fixed by manually disabling tuntap-tap and tuntap-tun. In this case, configure.ac would have to be updated to move AM_CONDITIONALcalls outside AS_IF conditions.
An other option would be to update AC_CHECK_DECLS to include linux/if_ether.h before linux/if_tun.h to detect musl conflicts and automatically disable tuntap-tap and tuntap-tun.
Full build log: http://autobuild.buildroot.org/results/d81/d815b864cb2dd719815af2436b919b8e093d3c1b/build-end.log
I think this might fix this.
In fact, this issue was already fixed since version 2.1.8 by https://sourceforge.net/p/iperf2/code/ci/81d603dab663e0c3c94a354a69f3f4ce30527097 and https://sourceforge.net/p/iperf2/code/ci/af0ea1dff77aa4e63cda5803dd6db24ace7ca9ff/
Last edit: Fabrice Fontaine 2024-04-16
Thanks for confirming this.