1、源码路径
https://iperf.fr/iperf-download.php
2、交叉编译
2.1、编译iperf
tar -xf iperf-3.1-source.tar.gz
cd iperf-3.1
./configure --prefix=$(pwd)/output --host=arm-linux-
make
make install
生成文件在output目录下
2.2、编译时可能遇到的问题
问题:
'gcrt1.o: No such file or directory
解决:修改src/Makefile.in文件
@@ -607,19 +607,12 @@ iperf3_LDFLAGS = -g
# Specify the sources and various flags for the profiled iperf binary. This
# binary recompiles all the source files to make sure they are all profiled.
-#iperf3_profile_SOURCES = main.c \
-# $(libiperf_la_SOURCES)
+iperf3_profile_SOURCES = main.c \
+ $(libiperf_la_SOURCES)
-#iperf3_profile_CFLAGS = -pg -g
-#iperf3_profile_LDADD = libiperf.la
-#iperf3_profile_LDFLAGS = -pg -g
-
-@ENABLE_PROFILING_TRUE@iperf3_profile_SOURCES = main.c \
-@ENABLE_PROFILING_TRUE@ $(libiperf_la_SOURCES)
-
-@ENABLE_PROFILING_TRUE@iperf3_profile_CFLAGS = -pg -g
-@ENABLE_PROFILING_TRUE@iperf3_profile_LDADD = libiperf.la
-@ENABLE_PROFILING_TRUE@iperf3_profile_LDFLAGS = -pg -g
+iperf3_profile_CFLAGS = -pg -g
+iperf3_profile_LDADD = libiperf.la
+iperf3_profile_LDFLAGS = -pg -g
# Specify the sources and various flags for the test cases