Hello Venkata,

Here's the fix for CC=armclang: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/47881. It was a type with the LTO everywhere patches.

As for LD=armlink, It's not as surface level so I'll look into it and get back to you.

Thanks,
Boyan

From: Taticharla, Venkata Sai via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 30 January 2026 11:03 AM
To: tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>
Cc: Belsare, Akshay <akshay.belsare@amd.com>; Bollapalli, Maheedhar Sai <MaheedharSai.Bollapalli@amd.com>; Gudipalli, Sugadeesh <sugadeesh.gudipalli@amd.com>
Subject: [TF-A] Unable to build the ZynqMP platform with armclang when ENABLE_LTO=1.
 
[AMD Official Use Only - AMD Internal Distribution Only]

Hello Maintainers,

we are trying to build TF‑A BL31 for the ZynqMP (Cortex‑A53) platform with Arm Compiler 6 (armclang) and ENABLE_LTO=1, and I’m running into several toolchain‑related build and link issues.

Setup :

Platform: ZynqMP
Toolchains:
Arm Compiler for Embedded 6.16.2 (armclang)
Xilinx AArch64 GNU tools from Vitis 2025.2 (aarch64-xilinx-elf-*)
LTO is enabled in plat/xilinx/zynqmp/platform.mk via ENABLE_LTO := 1.

Issues observed :

With CC=armclang and AArch64 linker (GCC), the build fails with:

armclang: error: unknown argument: '-flto-partition=one'
This flag appears when ENABLE_LTO=1 and the linker is detected as gnu-gcc.

If I keep CC=armclang and ENABLE_LTO=1 but change the linker, I get linker‑specific errors
With the Arm linker (LD=armlink or LD=armclang, which invokes armlink under the hood):

Fatal error: L3900U: Unrecognized option '-z'.
This is due to GNU‑style -z options (and similar flags) being passed to armlink.

As -z options is specific to GNU linker, a armlink style flag would address the unrecognised option but we are observing dependency on scatter files.
Fatal error: L6031U: Could not open scatter description file plat/xilinx/zynqmp//scat/bl31.scat: No such file or directory

Could you please help us with pointers to address the linker issues .

With regards ,
Venkata Sai .T .
--
TF-A mailing list -- tf-a@lists.trustedfirmware.org
To unsubscribe send an email to tf-a-leave@lists.trustedfirmware.org