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

相关推荐
森G2 小时前
七、04ledc-sdk--------makefile有变化
linux·c语言·arm开发·c++·ubuntu
VekiSon6 小时前
Linux内核驱动——杂项设备驱动与内核模块编译
linux·c语言·arm开发·嵌入式硬件
AI+程序员在路上6 小时前
Nand Flash与EMMC区别及ARM开发板中的应用对比
arm开发
17(无规则自律)12 小时前
深入浅出 Linux 内核模块,写一个内核版的 Hello World
linux·arm开发·嵌入式硬件
梁洪飞1 天前
内核的schedule和SMP多核处理器启动协议
linux·arm开发·嵌入式硬件·arm
代码游侠2 天前
学习笔记——Linux字符设备驱动
linux·运维·arm开发·嵌入式硬件·学习·架构
syseptember2 天前
Linux网络基础
linux·网络·arm开发
代码游侠2 天前
学习笔记——Linux字符设备驱动开发
linux·arm开发·驱动开发·单片机·嵌入式硬件·学习·算法
程序猿阿伟2 天前
《Apple Silicon与Windows on ARM:引擎原生构建与模拟层底层运作深度解析》
arm开发·windows
wkm9562 天前
在arm64 ubuntu系统安装Qt后编译时找不到Qt3DExtras头文件
开发语言·arm开发·qt