[systemd-commits] 5 commits - configure.ac Makefile.am src/boot

David Herrmann dvdhrm at kemper.freedesktop.org
Sat Apr 11 03:11:12 PDT 2015


 Makefile.am         |   27 ++++++++++++++++++++-------
 configure.ac        |    4 ++++
 src/boot/efi/util.c |    7 ++++++-
 3 files changed, 30 insertions(+), 8 deletions(-)

New commits:
commit 684edf2e19aa8e247d94443b34e3d1b909b0d960
Author: Koen Kooi <koen.kooi at linaro.org>
Date:   Sat Apr 11 10:23:26 2015 +0200

    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)

diff --git a/Makefile.am b/Makefile.am
index f30fe29..815e366 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

commit 0d8d3689071188d39c629c3d9d9bed52f9eecfc7
Author: Koen Kooi <koen.kooi at linaro.org>
Date:   Sat Apr 11 10:23:25 2015 +0200

    boot/util: add ticks_read() stub

diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c
index 4dd7c1e..5e374ed 100644
--- a/src/boot/efi/util.c
+++ b/src/boot/efi/util.c
@@ -39,6 +39,11 @@ UINT64 ticks_read(VOID) {
         __asm__ volatile ("rdtsc" : "=A" (val));
         return val;
 }
+#else
+UINT64 ticks_read(VOID) {
+        UINT64 val = 1;
+        return val;
+}
 #endif
 
 /* count TSC ticks during a millisecond delay */

commit 4c6abc93c708762ae3f377eab8dbd357262cc432
Author: Koen Kooi <koen.kooi at linaro.org>
Date:   Sat Apr 11 10:23:24 2015 +0200

    build: add AARCH64 efi support
    
    This is just plumbing to add ARCH_AARCH64 EFI support for makefile tests
    and defining the machine name.

diff --git a/configure.ac b/configure.ac
index 960b15d..6713e03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is
 SET_ARCH(X86_64, x86_64*)
 SET_ARCH(IA32, i*86*)
 SET_ARCH(MIPS, mips*)
+SET_ARCH(AARCH64, aarch64*)
 
 # i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
 AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
@@ -1160,6 +1161,9 @@ AM_COND_IF(ARCH_IA32, [
 AM_COND_IF(ARCH_X86_64, [
         EFI_MACHINE_TYPE_NAME=x64])
 
+AM_COND_IF(ARCH_AARCH64, [
+        EFI_MACHINE_TYPE_NAME=aa64])
+
 AC_SUBST([EFI_ARCH])
 AC_SUBST([EFI_MACHINE_TYPE_NAME])
 

commit 8403daa2840cbfb06963228469922c549455aeda
Author: Koen Kooi <koen.kooi at linaro.org>
Date:   Sat Apr 11 10:23:23 2015 +0200

    boot/util: use x86 ASM only on x86 platforms.

diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c
index ba5ed7d..4dd7c1e 100644
--- a/src/boot/efi/util.c
+++ b/src/boot/efi/util.c
@@ -33,7 +33,7 @@ UINT64 ticks_read(VOID) {
         __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
         return (d << 32) | a;
 }
-#else
+#elif defined(__i386__)
 UINT64 ticks_read(VOID) {
         UINT64 val;
         __asm__ volatile ("rdtsc" : "=A" (val));

commit 32ef61b88864e0de2edd8dbadfc315ee4c353324
Author: Koen Kooi <koen.kooi at linaro.org>
Date:   Sat Apr 11 10:23:22 2015 +0200

    build: support non-x86 EFI builds
    
    Move the no-mmx/no-sse CFLAGS to X86-64 and IA32 defines in preparation
    for ARM32 and Aarch64 support.

diff --git a/Makefile.am b/Makefile.am
index 1ff74bb..f30fe29 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2564,17 +2564,23 @@ efi_cflags = \
 	-fno-strict-aliasing \
 	-fno-stack-protector \
 	-Wsign-compare \
-	-Wno-missing-field-initializers \
-	-mno-sse \
-	-mno-mmx
+	-Wno-missing-field-initializers
 
 if ARCH_X86_64
 efi_cflags += \
 	-mno-red-zone \
+	-mno-sse \
+	-mno-mmx \
 	-DEFI_FUNCTION_WRAPPER \
 	-DGNU_EFI_USE_MS_ABI
 endif
 
+if ARCH_IA32
+efi_cflags += \
+	-mno-sse \
+	-mno-mmx
+endif
+
 efi_ldflags = \
 	$(EFI_LDFLAGS) \
 	-T $(EFI_LDS_DIR)/elf_$(EFI_ARCH)_efi.lds \



More information about the systemd-commits mailing list