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)
This commit is contained in:
Koen Kooi 2015-04-11 10:23:26 +02:00 committed by David Herrmann
parent 0d8d368907
commit 684edf2e19
1 changed files with 11 additions and 4 deletions

View 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