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

相关推荐
苏三福2 小时前
rk3588/3576板端编译程序无法运行视频推理
arm开发·音视频
年轮不改4 小时前
ARM Linux平台下 OpenCV Camera 实验
linux·arm开发·qt
初学者52135 小时前
SRS编译arm版本出错 ERROR: opus not found using pkg-config
arm开发
艾格北峰12 小时前
STM32 物联网智能家居 (六) OLED显示设备
arm开发·stm32·单片机·嵌入式硬件·物联网·智能家居
BlueBirdssh19 小时前
ARM SOC 架构系统M系、R系、A系
arm开发·架构
年轮不改20 小时前
ARM-Linux 基础项目篇——简单的视频监控
linux·arm开发
7yewh1 天前
嵌入式知识点总结 网络编程 专题提升(二)-HTTP/IP
网络·arm开发·物联网·网络协议·http·硬件工程
yuansec1 天前
arm环境下,wpa_supplicant交叉编译+wifi sta连接详解
arm开发·wpa_supplicant·udhcpc
BlueBirdssh1 天前
**ARM Cortex-M4** 和 **ARM Cortex-M7* 运行freeRTOS
arm开发
神秘_博士1 天前
自制AirTag,支持安卓/鸿蒙/PC/Home Assistant,无需拥有iPhone
arm开发·python·物联网·flutter·docker·gitee