Skip to content

Failed to build Toolchains and TF-A on Arm64 Server

Build environment: Arm64 server with Ubuntu 22.04 installed.

Use the command to build toolchains failed: make -j8 CCA_SUPPORT=y toolchains

root@arm-test-snow:~/cca-v3-2/build# make -j8 CCA_SUPPORT=y toolchains
Downloading gcc-arm-10.2-2020.11-aarch64-arm-none-linux-gnueabihf ...
Building aarch64 toolchain
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/root/cca-v3-2/buildroot'
mkdir -p /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/lxdialog
PKG_CONFIG_PATH="" make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
    obj=/root/cca-v3-2/out-aarch64-sdk/build/buildroot-config -C support/kconfig -f Makefile.br conf
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/root/cca-v3-2/out-aarch64-sdk/build/buildroot-config -DCONFIG_=\"\"  -MM *.c > /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/.depend 2>/dev/null || :
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/root/cca-v3-2/out-aarch64-sdk/build/buildroot-config -DCONFIG_=\"\"   -c conf.c -o /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/conf.o
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/root/cca-v3-2/out-aarch64-sdk/build/buildroot-config -DCONFIG_=\"\"  -I. -c /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/zconf.tab.c -o /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/zconf.tab.o
/usr/bin/gcc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/root/cca-v3-2/out-aarch64-sdk/build/buildroot-config -DCONFIG_=\"\"   /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/conf.o /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/zconf.tab.o  -o /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/conf
rm /root/cca-v3-2/out-aarch64-sdk/build/buildroot-config/zconf.tab.c
  GEN     /root/cca-v3-2/out-aarch64-sdk/Makefile
#
# configuration written to /root/cca-v3-2/out-aarch64-sdk/.config
#
make[1]: Leaving directory '/root/cca-v3-2/buildroot'
make[1]: Entering directory '/root/cca-v3-2/out-aarch64-sdk'
Makefile.legacy:9: *** "You have legacy configuration in your .config! Please check your configuration.".  Stop.
make[1]: *** [Makefile:23: _all] Error 2
make[1]: Leaving directory '/root/cca-v3-2/out-aarch64-sdk'
make: *** [toolchain.mk:136: /root/cca-v3-2/build/../toolchains/aarch64/.done] Error 2
make: *** Waiting for unfinished jobs....`

/root/cca-v3-2/out-aarch64-sdk/.config includes a legacy configuration: BR2_GCC_VERSION_10_X=y Workaround method is comment: br-ext/configs/sdk-common:3:BR2_GCC_VERSION_10_X=y

Then we can finish the toolchain build, but will fail in build TF-A:

/root/cca-v3/toolchains/aarch64/bin/../lib/gcc/aarch64-buildroot-linux-gnu/13.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /root/cca-v3/trusted-firmware-a/build/qemu/release/bl1/bl1.elf: error: PHDR segment not covered by LOAD segment
[0/1] Cleaning custom target directoriescollect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1498: /root/cca-v3/trusted-firmware-a/build/qemu/release/bl1/bl1.elf] Error 1
make[1]: Leaving directory '/root/cca-v3/trusted-firmware-a'
make: *** [Makefile:251: arm-tf] Error 2
make: *** Waiting for unfinished jobs....
  CC      drivers/bus/arm-cci.o
  AR      kernel/printk/built-in.a
  CC      crypto/scompress.o
  CC      block/genhd.o
[1/1] Cleaning custom target directories

Looks that the GCC 13.3 is not compatible with some dependencies.

Edited by Kevin Zhao