iperf编译

源码下载地址:
iPerf - Download iPerf3 and original iPerf pre-compiled binaries

编译配置:
 

./configure --host=aarch64-v8aqcom-linux CC=aarch64-v8aqcom-linux-gcc CFLAGS=-static CXX=aarch64-v8aqcom-linux-g++ CXXFLAGS=-static


–host: 指定交叉编译工具,一般为arm-none-linux-gnueabi、arm-linux-gnueabihf、arm-linux等,具体要和目标板用的交叉编译工具对应。

编译:
然后 make 编译即可,编译完成,可在 src 目录下找到编译好的 iperf 应用,因其为静态编译,故直接将其放到开发板里就可以了

编译配置可能出现的bug:
1、需要更新config文件
报错:host system type... Invalid configuration `aarch64-v8aqcom-linux': machine `aarch64-v8aqcom' not recognized
解决措施:
下载这两个配置文件(config.guess和config.sub)

​
wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

​


然后替换到源码的路径下

2、中间文件格式错误
报错:

gnu_getopt.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:414: recipe for target 'iperf' failed
make[2]: *** [iperf] Error 1
make[2]: Leaving directory '/home/xuzj/iperf-2.0.9/src'
Makefile:377: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/xuzj/iperf-2.0.9'
Makefile:317: recipe for target 'all' failed
make: *** [all] Error 2
根因:
错在.o文件格式错误,其实是之前不同编译链下编译的中间文件复用到此次编译导致的格式错误。
解决:
make clean清除一下之前编译的中间文件,再make

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值