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

相关推荐
satadriver2 天前
Qemu arm操作系统开发环境
arm开发
待什么青丝3 天前
【TMS570LC4357】之相关驱动开发学习记录1
c语言·arm开发·驱动开发·学习
南玖yy4 天前
x86 汇编逻辑运算全解析:从【位操作】到实际应用(AND,OR,NOT,XOR,TEST)
开发语言·汇编·arm开发·后端·架构·策略模式
菜只因C5 天前
嵌入式系统:从技术原理到未来趋势(驱动程序篇)
arm开发
!chen7 天前
鲲鹏Arm+麒麟V10 K8s 离线部署教程
java·arm开发·kubernetes
ScilogyHunter7 天前
ARM P15协处理器指令详解:架构、编程与应用实践
arm开发·协处理器指令·cp15
apolloyhl8 天前
1-Wire 一线式总线:从原理到实战,玩转 DS18B20 温度采集
arm开发·stm32·单片机·嵌入式硬件
二进制coder8 天前
芯片:数字时代的算力引擎——鲲鹏、升腾、海光、Intel 全景解析
arm开发·架构·硬件架构
荆楚闲人9 天前
Keil MDK5.37或更高版本不再预装ARM Compiler Version5导致编译错误的解决方法
arm开发
MonKingWD9 天前
【Redis原理】四万字总结Redis网络模型的全部概念
网络·arm开发·redis