]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
build: add support for AARCH64 EFI
authorKoen Kooi <koen.kooi@linaro.org>
Sat, 11 Apr 2015 08:23:26 +0000 (10:23 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sat, 11 Apr 2015 10:09:56 +0000 (12:09 +0200)
Aarch64 and ARM32 lack an EFI capable objcopy, so use the ldflags + -O
binary trick gnu-efi and the Red Hat shimloader are using.

(David: rebase to systemd-git and added EFI_ prefixes)

Makefile.am

index f30fe296aaeaf3e54b622e4ffccc15cb50b9c287..815e366b930a85ed5bfab2ac3e3fe4f4f045b731 100644 (file)
@@ -2591,6 +2591,15 @@ efi_ldflags = \
        -L $(EFI_LIB_DIR) \
        $(EFI_LDS_DIR)/crt0-efi-$(EFI_ARCH).o
 
+# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' instead,
+# and add required symbols manually.
+if ARCH_AARCH64
+efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
+EFI_FORMAT = -O binary
+else
+EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
+endif
+
 # ------------------------------------------------------------------------------
 systemd_boot_headers = \
        src/boot/efi/util.h \
@@ -2624,8 +2633,7 @@ $(systemd_boot_solib): $(systemd_boot_objects)
 
 $(systemd_boot): $(systemd_boot_solib)
        $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
-         -j .dynsym -j .rel -j .rela -j .reloc \
-         --target=efi-app-$(EFI_ARCH) $< $@
+         -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
 
 # ------------------------------------------------------------------------------
 stub_headers = \
@@ -2662,8 +2670,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-$(EFI_ARCH) $< $@
+         -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
 
 # ------------------------------------------------------------------------------
 CLEANFILES += test-efi-disk.img