summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@linaro.org>2015-04-11 10:23:26 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-04-11 12:09:56 +0200
commit684edf2e19aa8e247d94443b34e3d1b909b0d960 (patch)
tree3677b545e5322c2c761fab804bc0d27c5f4396bc
parent0d8d3689071188d39c629c3d9d9bed52f9eecfc7 (diff)
build: add support for AARCH64 EFI
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)
-rw-r--r--Makefile.am15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index f30fe296a..815e366b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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