Installing the Cross-Compilation Toolchain
- Go to Arm GNU Toolchain Downloads and select a recommended package version based on the OS architecture.
- x86 environment: arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf.tar.xz
- Arm environment: arm-gnu-toolchain-14.2.rel1-aarch64-aarch64-none-elf.tar.xz
The installation procedure is the same for different OSs. The following uses the x86 environment as an example. Download the toolchain package and decompress it to the local environment.
tar -xvf arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf.tar.xz
- Create symbolic links for the files in the bin folder of the extracted directory to the /usr/bin directory.
ln -sf {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/* /usr/bin/Example:
ln -sf /root/arm-gnu-toolchain/bin/* /usr/bin/
- Check whether the symbolic links are successfully created.
ll /usr/bin |grep aarch64-none-elf
The creation is successful if information similar to the following is displayed:
lrwxrwxrwx 1 root root 88 May 29 10:48 aarch64-none-elf-addr2line -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-addr2line lrwxrwxrwx 1 root root 81 May 29 10:48 aarch64-none-elf-ar -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-ar lrwxrwxrwx 1 root root 81 May 29 10:48 aarch64-none-elf-as -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-as lrwxrwxrwx 1 root root 82 May 29 10:48 aarch64-none-elf-c++ -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-c++ lrwxrwxrwx 1 root root 86 May 29 10:48 aarch64-none-elf-c++filt -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-c++filt lrwxrwxrwx 1 root root 82 May 29 10:48 aarch64-none-elf-cpp -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-cpp lrwxrwxrwx 1 root root 86 May 29 10:48 aarch64-none-elf-elfedit -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-elfedit lrwxrwxrwx 1 root root 82 May 29 10:48 aarch64-none-elf-g++ -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-g++ lrwxrwxrwx 1 root root 82 May 29 10:48 aarch64-none-elf-gcc -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc lrwxrwxrwx 1 root root 89 May 29 10:48 aarch64-none-elf-gcc-13.2.1 -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc-13.2.1 lrwxrwxrwx 1 root root 85 May 29 10:48 aarch64-none-elf-gcc-ar -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc-ar lrwxrwxrwx 1 root root 85 May 29 10:48 aarch64-none-elf-gcc-nm -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc-nm lrwxrwxrwx 1 root root 89 May 29 10:48 aarch64-none-elf-gcc-ranlib -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc-ranlib lrwxrwxrwx 1 root root 83 May 29 10:48 aarch64-none-elf-gcov -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcov lrwxrwxrwx 1 root root 88 May 29 10:48 aarch64-none-elf-gcov-dump -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcov-dump lrwxrwxrwx 1 root root 88 May 29 10:48 aarch64-none-elf-gcov-tool -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcov-tool lrwxrwxrwx 1 root root 82 May 29 10:48 aarch64-none-elf-gdb -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb lrwxrwxrwx 1 root root 92 May 29 10:48 aarch64-none-elf-gdb-add-index -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gdb-add-index lrwxrwxrwx 1 root root 87 May 29 10:48 aarch64-none-elf-gfortran -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gfortran lrwxrwxrwx 1 root root 84 May 29 10:48 aarch64-none-elf-gprof -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gprof lrwxrwxrwx 1 root root 81 May 29 10:48 aarch64-none-elf-ld -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-ld lrwxrwxrwx 1 root root 85 May 29 10:48 aarch64-none-elf-ld.bfd -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-ld.bfd lrwxrwxrwx 1 root root 87 May 29 10:48 aarch64-none-elf-lto-dump -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-lto-dump lrwxrwxrwx 1 root root 81 May 29 10:48 aarch64-none-elf-nm -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-nm lrwxrwxrwx 1 root root 86 May 29 10:48 aarch64-none-elf-objcopy -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objcopy lrwxrwxrwx 1 root root 86 May 29 10:48 aarch64-none-elf-objdump -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-objdump lrwxrwxrwx 1 root root 85 May 29 10:48 aarch64-none-elf-ranlib -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-ranlib lrwxrwxrwx 1 root root 86 May 29 10:48 aarch64-none-elf-readelf -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-readelf lrwxrwxrwx 1 root root 83 May 29 10:48 aarch64-none-elf-size -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-size lrwxrwxrwx 1 root root 86 May 29 10:48 aarch64-none-elf-strings -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-strings lrwxrwxrwx 1 root root 84 May 29 10:48 aarch64-none-elf-strip -> {Local download path}/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-strip - Check the version of the cross-compilation toolchain.
aarch64-none-elf-gcc -v
The installation is successful if the following information is displayed:
Using built-in specs. COLLECT_GCC=aarch64-none-elf-gcc COLLECT_LTO_WRAPPER=/home/CIDA/flexdacc/packages/arm-gnu-toolchain-14.2.rel1-aarch64-aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/14.2.1/lto-wrapper Target: aarch64-none-elf Configured with: /data/jenkins/workspace/GNU-toolchain/arm-14/src/gcc/configure --target=aarch64-none-elf --prefix=/data/jenkins/workspace/GNU-toolchain/arm-14/build-aarch64-none-elf/install --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-14/build-aarch64-none-elf/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-14/build-aarch64-none-elf/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-14/build-aarch64-none-elf/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-14/build-aarch64-none-elf/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c,c++,fortran --with-newlib --with-gnu-as --with-headers=yes --with-gnu-ld --with-native-system-header-dir=/include --with-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-14/build-aarch64-none-elf/install/aarch64-none-elf --with-bugurl=https://bugs.linaro.org/ --with-pkgversion='Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)' Thread model: single Supported LTO compression algorithms: zlib gcc version 14.2.1 20241119 (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52))
Parent topic: FAQs