From a2e2311a40696e39eb24ff4a4d4c0968bba42c8c Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Fri, 24 Apr 2020 10:03:11 +0000 Subject: [PATCH] Build the arm64 loader with -ffixed-x18 This stops the compiler from using the x18 register. Some UEFI implementations assume this will be preserved when calling the Boot Services. MFC after: 2 weeks Sponsored by: Innovate UK --- stand/defs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/defs.mk b/stand/defs.mk index 8d41c5f6f1b2..89ccf2f4bdbf 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -119,7 +119,7 @@ SSP_CFLAGS= # currently has no /boot/loader, but may soon. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -fPIC +CFLAGS+= -mgeneral-regs-only -ffixed-x18 -fPIC .elif ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -march=rv64imac -mabi=lp64 .else