Closed eballetbo closed 2 months ago
Actually I think you can pass CC=gcc CPP=gcc AS=gcc LD=gcc OC=objcopy AR=gcc-ar
to solve this, but would be good have native building on aarch64 just working.
This wasn't an issue with 2.10.x has anyone tried to bisect it to see which commit broke it?
I did a quick bisect run and pointed out to this commit. I didn't look further yet.
commit ffb7742125def3e0acca4c7e4d3215af5ce25a31 (HEAD)
Author: Chris Kay <chris.kay@arm.com>
Date: Mon Dec 4 12:03:51 2023 +0000
build: use new toolchain variables for tools
This change migrates the values of `CC`, `CPP`, `AS` and other toolchain
variables to the new `$(toolchain)-$(tool)` variables, which were
introduced by the toolchain refactor patch. These variables should be
equivalent to the values that they're replacing.
Change-Id: I644fe4ce82ef1894bed129ddb4b6ab94fb04985d
Signed-off-by: Chris Kay <chris.kay@arm.com>
Cc @CJKay
Hi this problem was discussed in https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/RV7Y4V3NBIDCFIV65UYXD4XTMNNV5QJP/
As mentioned above and in the ML , the usage is about providing CC variable. Would that be enough to fix build using TF-A v2.11 onwards? Or do we expect additional changes?
Hi @eballetbo, @nullr0ute, sorry - I didn't see this. It should be sufficient to just pass CC=gcc
- the rest of the toolchain will be picked up automatically, so you don't need to provide CPP
, AS
, etc.
Closing following resolution proposed by Chris.
So it doesn't appear to work as suggested, I get the following if I just set CC=gcc
when building:
+ make 'HOSTCC=gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' CROSS_COMPILE= PLAT=axg bl31 make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: The configured AArch64 archiver could not be identified and may not be supported: make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: aarch64-none-elf-gcc-ar make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: The default AArch64 archiver is: make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: aarch64-none-elf-gcc-ar make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: The following tools are supported: make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: - Arm® Compiler for Embedded
armar make_helpers/toolchain.mk:344: - LLVM
llvm-ar make_helpers/toolchain.mk:344: - GNU
ar make_helpers/toolchain.mk:344: make_helpers/toolchain.mk:344: The build system will treat this archiver as GNU
ar. make_helpers/toolchain.mk:344:
And then when it tries to use ar:
AR /builddir/build/BUILD/arm-trusted-firmware-2.11.0-build/trusted-firmware-a-2.11.0/build/axg/release/lib/libc.a make: aarch64-none-elf-gcc-ar: No such file or directory make: *** [Makefile:1491: /builddir/build/BUILD/arm-trusted-firmware-2.11.0-build/trusted-firmware-a-2.11.0/build/axg/release/lib/libc.a] Error 127
@nullr0ute Could you please post the output of:
which gcc
which gcc-ar
which aarch64-linux-gnu-gcc
which aarch64-linux-gnu-gcc-ar
Ah, never mind, I've located the issue. Resolved by: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/30994
Submitted Chris' change. Let us know if this helps, thanks.
Yes, it worked for me, thanks!
While cross compiling TF-A works without problems the toolchain helpers are not able to properly provide a toolchain set for native compilation or building on a aarch64 machine. It fails with the following error as is looking for a cross toolchain.