Rust交叉编译

Rust提供的编译工具链很好用。

但文档上支撑还是有些问题。

在 .cargo/config 下配置为:

[target.aarch64-unknown-linux-gnu]
linker = "/home/HwHiAiUser/toolchain/toolkit/toolchain/hcc/bin/aarch64-target-linux-gnu-gcc"

生成二进制的格式为:

ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, 
for GNU/Linux 3.7.0, with debug_info, not stripped

如果.cargo/config 配置为:

[target.aarch64-unknown-linux-gnu]
linker = "/home/HwHiAiUser/toolchain/toolkit/toolchain/hcc/bin/aarch64-target-linux-gnu-ld"

生成二进制的格式为:

node-43b020df73fb0fbc: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-,
 with debug_info, not stripped