From 54bfa07f00b25cd474be5ece09c85a211b1fdc2f Mon Sep 17 00:00:00 2001 From: Bart Kuivenhoven Date: Mon, 10 Mar 2014 12:42:25 +0100 Subject: Make: Compile for aarch64 ... sorta This commit fixes the build process for the current limitations of objcopy. Objcopy still has the problem of not fully understanding relocations so while this compiles, it will not be loadable by uefi. Signed-off-by: Bart Kuivenhoven --- gnu-efi-3.0/Make.defaults | 9 +++++++-- gnu-efi-3.0/Make.rules | 2 +- gnu-efi-3.0/apps/Makefile | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gnu-efi-3.0/Make.defaults b/gnu-efi-3.0/Make.defaults index cd5db7e..7b9eda4 100644 --- a/gnu-efi-3.0/Make.defaults +++ b/gnu-efi-3.0/Make.defaults @@ -46,8 +46,13 @@ TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) # lib and include under the root # INSTALLROOT := / -PREFIX := /usr/local -LIBDIR := $(PREFIX)/lib +ifeq ($(ARCH),aarch64) + PREFIX := /usr + LIBDIR := $(PREFIX)/lib64 +else + PREFIX := /usr/local + LIBDIR := $(PREFIX)/lib +endif INSTALL := install # Host/target identification diff --git a/gnu-efi-3.0/Make.rules b/gnu-efi-3.0/Make.rules index 65fb612..1078af0 100644 --- a/gnu-efi-3.0/Make.rules +++ b/gnu-efi-3.0/Make.rules @@ -36,7 +36,7 @@ %.efi: %.so $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ - -j .rela -j .reloc --target=$(FORMAT) $*.so $@ + -j .rela -j .reloc --subsystem=efi-app --target=$(FORMAT) $*.so $@ %.so: %.o $(LD) $(LDFLAGS) $^ -o $@ $(LOADLIBES) diff --git a/gnu-efi-3.0/apps/Makefile b/gnu-efi-3.0/apps/Makefile index bd7e658..91d4172 100644 --- a/gnu-efi-3.0/apps/Makefile +++ b/gnu-efi-3.0/apps/Makefile @@ -59,7 +59,9 @@ LOADLIBES += $(shell $(CC) $(ARCH3264) -print-libgcc-file-name) LOADLIBES += -T $(LDSCRIPT) ifeq ($(ARCH),aarch64) -FORMAT := pe-aarch64-little +FORMAT := pei-aarch64-little +#FORMAT := efi-app-aarch64 +PE_SUBSYSTEM := efi-app else FORMAT = efi-app-$(ARCH) endif -- cgit