From: Michael Brown Date: Fri, 26 Jun 2020 20:21:31 +0000 (+0100) Subject: [build] Disable position-independent code for ARM64 EFI builds X-Git-Tag: v1.21.1~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=decee20;p=thirdparty%2Fipxe.git [build] Disable position-independent code for ARM64 EFI builds Some versions of gcc (observed with the cross-compiling gcc 9.3.0 in Ubuntu 20.04) default to enabling -fPIE. Experimentation shows that this results in the emission of R_AARCH64_ADR_GOT_PAGE relocation records for __stack_chk_guard. These relocation types are not supported by elf2efi.c. Fix by explicitly disabling position-independent code for ARM64 EFI builds. Debugged-by: Antony Messerli Signed-off-by: Michael Brown --- diff --git a/src/arch/arm64/Makefile.efi b/src/arch/arm64/Makefile.efi index 998a64d03..eb04c0e2f 100644 --- a/src/arch/arm64/Makefile.efi +++ b/src/arch/arm64/Makefile.efi @@ -1,5 +1,9 @@ # -*- makefile -*- : Force emacs to use Makefile mode +# Avoid untranslatable relocations +# +CFLAGS += -fno-pic + # Specify EFI image builder # ELF2EFI = $(ELF2EFI64)