sgn - 2024-03-08

From binutils 2.38, objcopy learnt a new option --target=efi-app-aarch64
to build a PE/COFF executable for arm64.

Also "objcopy -O binary" no longer works with arm64:

/usr/bin/aarch64-linux-gnu-objcopy: refind_aa64.efi: file format not recognized

Switch to new option, unless we have old objcopy (by the define
OBJCOPY_LT_2_38).


Make.common | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Make.common b/Make.common
index 5dfa202..1fb6a97 100644
--- a/Make.common
+++ b/Make.common
@@ -154,8 +154,10 @@ endif

ifeq ($(ARCH), aarch64)
GNUEFI_CFLAGS += -DEFIAARCH64
+ ifneq ($(OBJCOPY_LT_2_38),)
FORMAT = -O binary
FORMAT_DRIVER = -O binary
+ endif
SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xa
LDFLAGS += --warn-common --no-undefined --fatal-warnings

--
2.44.0.rc0.258.g7320e9588666f