x86_64搭建ARM交叉编译工具链

点击上方"蓝字"关注我们

01、下载

>>>

GCC 64位交叉编译下载:https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/

喜欢那个版本自己找

02、简介

>>>

交叉编译器中"交叉"的意思就是在一个架构上编译另外一个架构的代码,相当于两种架构"交叉"起来了。交叉编译器有很多种,我们使用Linaro出品的交叉编译器,Linaro一间非营利性质的开放源代码软件工程公司,Linaro开发了很多软件,最著名的就是Linaro GCC编译工具链(编译器),关于Linaro详细的介绍可以到Linaro官网查阅。

下载官网:https://www.linaro.org/

03、传输到ubuntu20.04

>>>

使用FTP工具【FileZlilla】

官网:https://filezilla-project.org/index.php

发送成功

在Ubuntu中创建目录:/usr/local/arm,命令如下:sudo mkdir /usr/local/arm创建完成以后将刚刚拷贝的交叉编译器复制到/usr/local/arm 这个目录中,在终端使用命令"cd"进入到存放有交叉编译器的目录,比我前面将交叉编译器拷贝到了目录"

/home/whois/Linux/tool"中,然后使用如下命令将交叉编译器复制到/usr/local/arm中:

复制过来

解压

sudo tar -vxf gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar

04、配置环境变量

>>>

等待解压完成,解压完成以后会生成一个名为"/usr/local/tool/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf"的文件夹,这个文件夹里面就是我们的交叉编译工具链。

复制路径小方法

whois@ubuntu:/usr/local/tool/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf$ readlink -f bin/

/usr/local/tool/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin

修改环境变量,使用VI打开/etc/profile文件,命令如下:sudo vi /etc/profile打开/etc/profile 以后,在最后面输入如下所示内容:export PATH=$PATH:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin添加完成以后的/etc/profile如图4.3.1.7所示:

reboot重启

查看版本

arm-linux-gnueabihf-gcc -v

复制代码
whois@ubuntu:~$ arm-linux-gnueabihf-gcc -v使用内建 specs。COLLECT_GCC=arm-linux-gnueabihf-gccCOLLECT_LTO_WRAPPER=/usr/local/tool/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/7.5.0/lto-wrapper目标:arm-linux-gnueabihf配置为:'/home/tcwg-buildslave/workspace/tcwg-make-release_1/snapshots/gcc.git~linaro-7.5-2019.12/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/sysroots/arm-linux-gnueabihf --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release_1/_build/builds/destdir/x86_64-unknown-linux-gnu线程模型:posixgcc 版本 7.5.0 (Linaro GCC 7.5-2019.12)​​

总结

>>>

通过网盘分享的文件:GCC tool

链接: https://pan.baidu.com/s/1_d8OvqMLbl02PPX_ivpH9g?pwd=x349 提取码: x349

相关推荐
熠速5 小时前
PolarBox高性能实时仿真系统
arm开发·fpga开发·嵌入式实时数据库·硬件在环半实物仿真
天下·第二1 天前
如何在【x86】服务器上打包构建【arm】镜像
服务器·arm开发·eureka
止观止1 天前
在 WSL2 上从零搭建 ARM 混合编程环境
汇编·arm开发·嵌入式开发·混合编程
陌上花开缓缓归以2 天前
nand flash bbt和bmt管理
arm开发
小熊officer2 天前
AMD架构与ARM架构
arm开发·架构
_kerneler3 天前
arm虚拟机实时性优化总结
arm开发
口袋里のInit3 天前
基础知识——ARM M核入栈出栈流程
开发语言·arm开发
2035去旅行4 天前
WIFI传输带宽
arm开发·嵌入式硬件
陌上花开缓缓归以4 天前
nand flash 驱动适配
arm开发
振南的单片机世界4 天前
影子寄存器:改ARR下个周期才生效,波形不突变
arm开发·stm32·单片机·嵌入式硬件