Arch Linux 搭建 arm64/AArch64 交叉编译环境
0. 系统环境
系统:
Arch Linux: 成文时间最新
工具版本:Binutils:2.34-1
GCC:9.2.1+20200130-2
GNUMake:4.3
1. 编译交叉编译工具链
此部分参考博客.
交叉编译工具链需要用到至少七个工具(库):Binutilshttps://www.gnu.org/software/binutils/
GCC https://gcc.gnu.org/
glibc https://www.gnu.org/software/libc/
LinuxKernelhttps://www.kernel.org/
MPFR https://www.mpfr.org/
GMP https://gmplib.org/
MPC http://www.multiprecision.org/mpc
同时我们还有两个用于优化的库:http://isl.gforge.inria.fr/
CLooGhttps://github.com/periscop/cloog
这两个库是可选的.
搭建完成后我们会获得一系列编译, 链接工具, 包括我们熟知的 gcc,ld 等.
1.1 准备工作
首先建立三个目录, 分别存放源码, 构建文件和编译结果(也即我们需要的交叉编译工具链)mkdir-p/path/to/cross-compile-src/
mkdir-p/path/to/cross-compile-build/
mkdir-p/path/to/cross-compile-install/
exportCROSS_COMPILE_SRC=/path/to/cross-compil