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

相关推荐
wdfk_prog14 小时前
[Linux]学习笔记系列 -- [arm][lib]
linux·运维·arm开发·笔记·学习
努力自学的小夏1 天前
RK3568 Linux驱动学习——新字符设备驱动
linux·arm开发·驱动开发·笔记·学习
wdfk_prog3 天前
[Linux]学习笔记系列 -- [arm][lds]
linux·运维·arm开发·笔记·学习
szxinmai主板定制专家3 天前
基于FPGA的热电偶测温数据采集系统,替代NI的产品(二)总体设计方案
arm开发·人工智能·嵌入式硬件·fpga开发
cici158744 天前
ARM保留的标准中断处理程序入口和外设中断处理程序入口介绍
arm开发
学不动CV了5 天前
FreeRTOS入门知识(初识RTOS任务调度)(三)
c语言·arm开发·stm32·单片机·物联网·算法·51单片机
程序员JerrySUN5 天前
四级页表通俗讲解与实践(以 64 位 ARM Cortex-A 为例)
java·arm开发·数据库·redis·嵌入式硬件·缓存
zhmc6 天前
MCU程序的ARM-GCC编译链接
arm开发·单片机·嵌入式硬件
wdfk_prog6 天前
[Linux]学习笔记系列 -- [arm][debug]
linux·运维·arm开发·笔记·学习
皮蛋sol周7 天前
嵌入式学习硬件(一)ARM体系架构
arm开发·学习·架构