Hi Ard,
Thank you for pointing the patch!
I checked gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu compiler and indeed -fno-asynchronous-unwind-tables are enough to compile succesfully. Marvell gcc still has GenFW problems though: http://pastebin.com/KyYKj00D
Regardless of that, let's drop this patch for now. Since almost entire patchset is acked, I certainly don't want to block it with this issue.
Best regards, Marcin
2016-07-11 9:51 GMT+02:00 Ard Biesheuvel ard.biesheuvel@linaro.org:
On 10 July 2016 at 20:45, Marcin Wojtas mw@semihalf.com wrote:
Hi Ard,
2016-07-10 14:22 GMT+02:00 Ard Biesheuvel ard.biesheuvel@linaro.org:
On 10 July 2016 at 02:21, Marcin Wojtas mw@semihalf.com wrote:
From: Haim Boot hayim@marvell.com
The relocation type R_AARCH64_PREL32 in .rela.eh_frame (exception handling frame) does not fit the checking requirement of GenFw in EDK2.
Building EDK2 with aarch64-elf bare metal toolchain (no unwind table by default) will succeed. However build of EDK2 with aarch64-linux-gnueabi toolchain (default enable unwind table generation) will fail.
EABI is closely tied to 32-bit ARM/AArch32, and so there is no such thing as a 'aarch64-linux-gnueabi' compiler.
You are right, I checked, and the compiler in question is in fact aarch64-marvell-linux-gnu-
The issue can be fixed by adding -fno-unwind-tables, in order to disable generating unwind table info, which is used mainly for debug. This commit enables successful compilation of EDK2 both with aarch64-elf and aarch64-linux-gnueabi toolchains.
This has nothing to do with bare metal vs hosted. Are you using the RedHat build of GCC by any chance?
No, it's Marvell GCC toolchain. Do you have more remarks apart from s/gnueabi/gnu? I can ask Marvell to answer them, however I'd like to know your opinion if we can give a chance for such patch at all or it's a hopeless effort from the very beginning.
We already fixed a similar issue in EDK2 commit 28e80befa4fe0ed:
""" BaseTools: aarch64: add -fno-asynchronous-unwind-tables to gcc cflags
Some toolchains, at least Fedora GCC, generate inline unwind tables in object files. These confuses GenFw to no end, leading to build failures: GenFw: ERROR 3000: Invalid WriteSections64(): ... unsupported ELF EM_AARCH64 relocation 0x105. GenFw: ERROR 3000: Invalid WriteSections64(): ... unsupported ELF EM_AARCH64 relocation 0x0.
I am aware of no current use of these tables, so explicitly disable their generation for aarch64.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm leif.lindholm@linaro.org Tested-by: Wei Huang wei@redhat.com Reviewed-by: Olivier Martin olivier.martin@arm.com """
Note that ELF_EM_AARCH64 0x105 is the R_AARCH64_PREL32 you mention as well.
Since this setting is now applied globally, could you please check first if you still need this flag in the first place? Disabling unwind table generation altogether may affect debug capability, so it is better to keep the tables, but put them in a debug section (please refer to 26ecc55c027d77 for more details)
Thanks, Ard.