Hi Boyan,
Till 2.10 if we use LD=aarch64-none-elf-ld directly as build command parameter there was no problem with the build but with ENABLE_LTO patch we got build problems. Are there any generic recommendations on what to use for LD variable (LD=aarch64-none-elf-gcc & LD=aarch64-none-elf-ld) and any plan further in upstream to fix this issue for ENABLE_LTO case.
Regards, Maheedhar.
-----Original Message----- From: Boyan Karatotev via TF-A tf-a@lists.trustedfirmware.org Sent: Monday, January 6, 2025 12:58 PM To: tf-a@lists.trustedfirmware.org Subject: [TF-A] Re: Linker errors with ENABLE_LTO and LD overriding
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Hi Maheedhar,
Build command : make -j12 CC=aarch64-none-elf-gcc LD=aarch64-none-elf-ld CROSS_COMPILE=aarch64-none-elf- PLAT=zynqmp RESET_TO_BL31=1 DEBUG=1 ZYNQMP_CONSOLE=dtb bl31> arm-trusted-
firmware$
aarch64-none-elf-ld --version
GNU ld (GNU Binutils) 2.42.0.20240620
arm-trusted-firmware$ aarch64-none-elf-gcc --version
aarch64-xilinx-elf-gcc.real (GCC) 13.3.0
Have you tried with `LD=aarch64-none-elf-gcc`? That built for me. Inspecting the top level Makefile seems to suggest LTO will only work when gcc is used as the linker and nothing else. Do you need to use ld directly? LTO seems underused so stuff might be broken (I found https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/33984 recently).
Cheers, Boyan -- TF-A mailing list -- tf-a@lists.trustedfirmware.org To unsubscribe send an email to tf-a-leave@lists.trustedfirmware.org