iperf3 arm交叉编译补充.docx

上传人:A*** 文档编号:142724714 上传时间:2020-08-22 格式:DOCX 页数:8 大小:114.21KB
返回 下载 相关 举报
iperf3 arm交叉编译补充.docx_第1页
第1页 / 共8页
iperf3 arm交叉编译补充.docx_第2页
第2页 / 共8页
iperf3 arm交叉编译补充.docx_第3页
第3页 / 共8页
iperf3 arm交叉编译补充.docx_第4页
第4页 / 共8页
iperf3 arm交叉编译补充.docx_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《iperf3 arm交叉编译补充.docx》由会员分享,可在线阅读,更多相关《iperf3 arm交叉编译补充.docx(8页珍藏版)》请在金锄头文库上搜索。

1、iperf3 arm交叉编译补充【Android免费音乐下载app】【佳语音乐下载】写这个app完全出于对个人爱好。建议最少2.0.3版本https:/ ndk交叉编译可执行文件的步骤。系统版本:【cat /proc/version】Linux szxphispra14104 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux系统位数:【uname -a】Linux version 4.4.0-62-generic (builddlcy01-30) (gcc ve

2、rsion 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu116.04.4) ) #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 20171、iperf3源码下载地址;下载地址:http:/ android-ndk-r21-linux-x86_64.zip ,这个里面是使用clang编译的。编译中遇到问题。暂时使用之前版本使用gcc编译。使用的ndk版本为:android-ndk-r14b-linux-x86_64.zip3、将ndk解压到linux的/data01/ndk/目录中因为这个压缩文件有800M,需要分卷。将所有分卷ftp下载

3、到本地【get file】.多个分卷合并成一个【cat android-ndk-r14b.z* android-ndk-r14b-combo.zip】root:pcname:/data01/ndk/#zip解压命令【unzip android-ndk-r14b-combo.zip】4、配置环境变量【vi /etc/profile】在文件的末尾加上export NDK=/data01/ndk/android-ndk-r14bexport NDK_CROSS=/data01/ndk/AndroidToolChain/binPATH= $ PATH:$ NDK:$ NDK_CROSS说明下,由于编辑

4、器问题,$是没有空格的配置完成使其立即生效【source /etc/profile】说明:在profile配置的是永久环境变量,如果在命令行使用export NDK=/data01/ndk/android-ndk-r14b 是临时的,这个会话结束就失效了。NDK_CROSS这个是交叉编译工具链的路径5、生成工具链【$NDK/build/tools/make-standalone-toolchain.sh -platform=android-23arch=arm -install-dir=/data01/ndk/AndroidToolChain/】如果不是第一次配置就加上 -force参数,例如

5、:【$NDK/build/tools/make-standalone-toolchain.sh -platform=android-23 -arch=arm -install-dir=/data01/ndk/AndroidToolChain/ -force】这个时候就自动创建好 /data01/ndk/AndroidToolChain/ 这个目录如果执行上面的命令没有权限,就使用chmod配置下,例如:【chmod 777 $NDK/build/tools/make-standalone-toolchain.sh】将目录及其子目录下的所有文件添加权限命令【chmod -R 777 *】6、查看

6、交叉编译环境是否OK,可以查看下gcc版本【arm-linux-androideabi-gcc -v】Using built-in specs.COLLECT_GCC=arm-linux-androideabi-gccCOLLECT_LTO_WRAPPER=/data01/ndk/AndroidToolChain/bin/libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapperTarget: arm-linux-androideabiConfigured with: /usr/local/google/buildbot/src/android/gc

7、c/toolchain/build/gcc/gcc-4.9/configure -prefix=/tmp/59719db9ae19ff43aef46bbcb79596b6 -target=arm-linux-androideabi -host=x86_64-linux-gnu -build=x86_64-linux-gnu -with-gnu-as -with-gnu-ld -enable-languages=c,c+ -with-gmp=/buildbot/tmp/build/toolchain/temp-install -with-mpfr=/buildbot/tmp/build/tool

8、chain/temp-install -with-mpc=/buildbot/tmp/build/toolchain/temp-install -with-cloog=/buildbot/tmp/build/toolchain/temp-install -with-isl=/buildbot/tmp/build/toolchain/temp-install -with-ppl=/buildbot/tmp/build/toolchain/temp-install -disable-ppl-version-check -disable-cloog-version-check -disable-is

9、l-version-check -enable-cloog-backend=isl -with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc+,-Bdynamic -lm -disable-libssp -enable-threads -disable-nls -disable-libmudflap -disable-libgomp -disable-libstdc_-v3 -disable-sjlj-exceptions -disable-shared -disable-tls -disable-libitm -with-float=so

10、ft -with-fpu=vfp -with-arch=armv5te -enable-target-optspace -enable-bionic-libs -enable-libatomic-ifuncs=no -enable-initfini-array -disable-nls -prefix=/tmp/59719db9ae19ff43aef46bbcb79596b6 -with-sysroot=/tmp/59719db9ae19ff43aef46bbcb79596b6/sysroot -with-binutils-version=2.25 -with-mpfr-version=3.1

11、.1 -with-mpc-version=1.0.1 -with-gmp-version=5.0.5 -with-gcc-version=4.9 -with-gdb-version=none -with-gxx-include-dir=/tmp/59719db9ae19ff43aef46bbcb79596b6/include/c+/4.9.x -with-bugurl=http:/ -enable-languages=c,c+ -disable-bootstrap -enable-plugins -enable-libgomp -enable-gnu-indirect-function -di

12、sable-libsanitizer -enable-gold -enable-threads -enable-eh-frame-hdr-for-static -enable-graphite=yes -with-isl-version=0.11.1 -with-cloog-version=0.18.0 -with-arch=armv5te -program-transform-name=s&arm-linux-androideabi-& -enable-gold=defaultThread model: posixgcc version 4.9.x 20150123 (prerelease)

13、 (GCC)可以通过一个简单c程序测试 #include int main() printf(hi,androidn); return 0; 【arm-linux-androideabi-gcc test.c -o test】正常应该会输出 test文件出来【file test】查看就是一个arm类型的文件如果是linux下使用,就直接使用【gcc test.c -o test】【./test】就可以直接运行了7、将下载好的iperf源码解压到linux本地tar.gz格式使用tar命令解压【tar -xvf iperf-3.7.tar.gz】8、进入iperf目录,输入命令【./config

14、ure -host=arm-linux CC=arm-linux-androideabi-gcc CXX=arm-linux-androideabi-g+ CFLAGS=-static -fPIC CXXFLAGS=-static LDFLAGS=-pie -fuse-ld=bfd】生成Makefile文件9、编译make【make】正常不报错就会在src目录生成iperf3的执行文件10、正常生成的iperf3在app是运行不起来的,需要改些配置iperf3.3需要修改net.c -#include +#include 包名修改 -tempdir = /tmp; +tempdir = /data/data/com.example.test;=编译中遇到的一些问题及解决方法:1、运行遇到“fatal error: stdio.h: No such file or directory”安装下这个【sudo apt-get install build-essential】2、遇到“Linux gnu

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > IT计算机/网络 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号