[systemd-devel] [gummiboot][PATCH 5/5] Makefile.am: Add support for AARCH64

Koen Kooi koen.kooi at linaro.org
Sat Apr 11 01:23:26 PDT 2015


Aarch64 and ARM32 lack an EFI capable objcopy, so use the ldflags + -O
binary trick gnu-efi and the Red Hat shimloader are using.

Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
---
 Makefile.am | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2cca313..eba5ec4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -121,6 +121,17 @@ efi_ldflags = \
 	-L $(EFI_LIB_DIR) \
 	$(EFI_LDS_DIR)/crt0-efi-$(ARCH).o
 
+# Aarch64 and ARM32 don't have an EFI capable objcopy
+if ARCH_AARCH64
+efi_ldflags += \
+	--defsym=EFI_SUBSYSTEM=0xa
+
+FORMAT = -O binary
+else
+FORMAT = --target=efi-app-$(ARCH) 
+endif
+
+
 # ------------------------------------------------------------------------------
 gummiboot_headers = \
 	src/efi/util.h \
@@ -156,7 +167,7 @@ $(gummiboot_solib): $(gummiboot_objects)
 $(gummiboot): $(gummiboot_solib)
 	$(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
 	  -j .dynsym -j .rel -j .rela -j .reloc \
-	  --target=efi-app-$(ARCH) $< $@
+	  $(FORMAT) $< $@
 
 # ------------------------------------------------------------------------------
 stub_headers = \
@@ -191,7 +202,7 @@ $(stub_solib): $(stub_objects)
 $(stub): $(stub_solib)
 	$(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
 	  -j .dynsym -j .rel -j .rela -j .reloc \
-	  --target=efi-app-$(ARCH) $< $@
+	  $(FORMAT) $< $@
 
 # ------------------------------------------------------------------------------
 CLEANFILES += test-disk.img
-- 
2.0.1



More information about the systemd-devel mailing list