Hi Chris,
With latest upstream master with below patch you have suggested we got some link time errors as mentioned in logs below. However with another patch https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/26703, this link errors got resolved. We can now enable ENABLE_LTO flag in platform.mk. Once all related patches are merged upstream, we will submit our platform specific patch for ENABLE_LTO.
Logs: (.text.asm.handle_interrupt_exception+0x20): undefined reference to `plat_ic_get_pending_interrupt_type' (.text.asm.handle_interrupt_exception+0x20): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `plat_ic_get_pending_interrupt_type' (.text.asm.handle_interrupt_exception+0x2c): undefined reference to `get_interrupt_type_handler' (.text.asm.handle_interrupt_exception+0x2c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `get_interrupt_type_handler' /aarch64-xilinx-elf-ld.bfd.real: trusted-firmware-a/build/zynqmp/release/bl31/crash_console_helpers.o: in function `plat_crash_console_putc': (.text.asm.plat_crash_console_putc+0x18): undefined reference to `console_list'
Regards, Prasad.
From: Chris Kay Chris.Kay@arm.com Sent: Monday, February 26, 2024 8:50 PM To: Simek, Michal michal.simek@amd.com; Kummari, Prasad Prasad.Kummari@amd.com; tf-a@lists.trustedfirmware.org Cc: Nagal, Amit amit.nagal@amd.com; Belsare, Akshay akshay.belsare@amd.com Subject: Re: ENABLE_LTO feature usage.
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Sorry for the delay, folks - we did some pipecleaning of some changes that conflicted with this. I've pushed the following change, which should enable this:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/26693
Chris
From: Chris Kay via TF-A mailto:tf-a@lists.trustedfirmware.org Date: Monday, 5 February 2024 at 14:27 To: Michal Simek mailto:michal.simek@amd.com, Kummari, Prasad mailto:Prasad.Kummari@amd.com, mailto:tf-a@lists.trustedfirmware.org mailto:tf-a@lists.trustedfirmware.org Cc: Nagal, Amit mailto:amit.nagal@amd.com, Belsare, Akshay mailto:akshay.belsare@amd.com Subject: [TF-A] Re: ENABLE_LTO feature usage. I've triggered CI+2 on the LTO-by-default patch, but it's encountering build failures already: https://ci.trustedfirmware.org/job/tf-a-gerrit-tforg-l2/1689/ I'll try to find some time to move the LTO configuration after platform file inclusion later this week, unless anybody else is willing to volunteer to get it sorted faster. Chris From: Michal Simek mailto:michal.simek@amd.com Date: Monday, 5 February 2024 at 12:21 To: Chris Kay mailto:Chris.Kay@arm.com, Kummari, Prasad mailto:Prasad.Kummari@amd.com, mailto:tf-a@lists.trustedfirmware.org mailto:tf-a@lists.trustedfirmware.org Cc: Nagal, Amit mailto:amit.nagal@amd.com, Belsare, Akshay mailto:akshay.belsare@amd.com Subject: Re: ENABLE_LTO feature usage.
On 2/5/24 13:04, Chris Kay wrote:
Assuming it still fails to pass then we could perhaps move the LTO check somewhere after the platform file is included and hope for the best. It's a bit spaghetti and it would break any platforms that read ENABLE_LTO, but I don't think there are any so cross fingers and hope for the best.
With that said, we also ought to address any failures anyway because they are generally indicative of UB or broken linker scripts.
I am reading it that you will do this step and keep us in CC and we are happy to test and help and we will definitely set it up for that one configuration.
Thanks, Michal