准备
环境准备
- 一台带网络端口且操作系统为Ubuntu 22.04的x86 Linux服务器。
- Linux服务器已安装python、make、gcc、unzip、pigz、bison、flex、libncurses-dev、squashfs-tools、bc、device-tree-compiler、libssl-dev、cmake与交叉编译工具链。
工具链安装
- 登录Linux服务器。
- 执行如下命令,切换至root用户。
su - root
- 执行如下命令,创建/opt/compiler目录。
mkdir /opt/compiler
- 将交叉编译工具链包“toolchain.tar.gz”上传至/opt/compiler目录。详细操作请参见Windows与开发者套件的文件传输。
- 进入到/opt/compiler目录。
cd /opt/compiler
- 执行如下命令,解压交叉编译工具。
tar -xvf toolchain.tar.gz -C ./
- 在配置文件中增加交叉编译工具链路径。
echo "export PATH=/opt/compiler/toolchain/bin:\$PATH: " >> /etc/profile
- 执行如下命令,使环境变量生效。
source /etc/profile
- 执行如下命令,查看交叉编译工具链版本。
aarch64-target-linux-gnu-gcc -v
显示有版本信息,则表明安装工具链成功。
父主题: 接口复用操作