Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cross compile and static iperf3 v3.16 binary
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Naix
n00b
n00b


Joined: 28 Feb 2024
Posts: 3

PostPosted: Wed Feb 28, 2024 6:13 pm    Post subject: Cross compile and static iperf3 v3.16 binary Reply with quote

Hi all,
Recently iperf3 specifically version 3.16 has started to use stdatomic.h
this has resulted in some difficulties in cross compiling and static linking an iperf3 binary on Arm 32 bit

Tried the following commands (This command worked for v3.15 when they did not use stdatomic.h):

Code:
./configure --host=arm-linux-gnueabi --enable-static-bin --disable-shared
make -j$(nproc)


which resulted in this error:

Code:
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_tcp.c:68: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: ./.libs/libiperf.a(iperf_tcp.o): in function `iperf_tcp_send':
/root/Compile_Drop/iperf-3.16/src/iperf_tcp.c:100: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_tcp.c:101: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_tcp.c:105: undefined reference to `__atomic_load_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: ./.libs/libiperf.a(iperf_udp.o): in function `iperf_udp_recv':
/root/Compile_Drop/iperf-3.16/src/iperf_udp.c:96: undefined reference to `__atomic_load_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_udp.c:100: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_udp.c:101: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: ./.libs/libiperf.a(iperf_udp.o): in function `iperf_udp_send':
/root/Compile_Drop/iperf-3.16/src/iperf_udp.c:263: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_udp.c:264: undefined reference to `__atomic_fetch_add_8'
/usr/libexec/gcc/arm-linux-gnueabi/ld: /root/Compile_Drop/iperf-3.16/src/iperf_udp.c:267: undefined reference to `__atomic_load_8'


I tried tweaking the configure a bit with the following:

Code:
./configure --host=arm-linux-gnueabi --enable-static-bin --disable-shared LDFLAGS="-latomic"
make -j$(nproc)


which resulted in this error:

Code:
/usr/libexec/gcc/arm-linux-gnueabi/ld: attempted static link of dynamic object `/usr/lib/gcc/arm-linux-gnueabi/13/libatomic.so'
/usr/libexec/gcc/arm-linux-gnueabi/ld: attempted static link of dynamic object `/usr/lib/gcc/arm-linux-gnueabi/13/libatomic.so'
/usr/libexec/gcc/arm-linux-gnueabi/ld: attempted static link of dynamic object `/usr/lib/gcc/arm-linux-gnueabi/13/libatomic.so'
/usr/libexec/gcc/arm-linux-gnueabi/ld: attempted static link of dynamic object `/usr/lib/gcc/arm-linux-gnueabi/13/libatomic.so'
/usr/libexec/gcc/arm-linux-gnueabi/ld: attempted static link of dynamic object `/usr/lib/gcc/arm-linux-gnueabi/13/libatomic.so'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status


It seems that the compiling is picking the wrong object for some reason (libatomic.so instead of libatomic.a?)

For reference I tried to compile for Arm 64 bit

Quote:
./configure --host=aarch64-unknown-linux-gnu --enable-static-bin
make -j$(nproc)


and it succeeded and produced a cross compiled statically linked binary...

Why is this happening specifically on arm-linux-gnueabi?
Why is it picking the dynamic object instead?
_________________
Kind regards, Naix
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum