boot: Always use ELF Tool Chain elfcopy for EFI builds

We now use llvm-objcopy by default (as of commit 1cae7121c6), but it
does not support efi-app-x86_64 and similar ouptut formats (for more
detail see LLVM issue 108609[1]).

Go back to installing ELF Tool Chain's version of objcopy as elfcopy
(the standard upstream name) and use it for EFI builds.

[1] https://github.com/llvm/llvm-project/issues/108609).

PR:		280771
Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49362
This commit is contained in:
Ed Maste
2025-03-14 12:42:15 -04:00
parent 74361d693a
commit b885643b63
7 changed files with 18 additions and 9 deletions
+1
View File
@@ -26,6 +26,7 @@ EFI_TARGET= efi-app-x86_64
.else
EFI_TARGET= binary
.endif
EFI_OBJCOPY?= elfcopy
# Arbitrarily set the PE/COFF header timestamps to 1 Jan 2024 00:00:00
# for build reproducibility.
+1 -1
View File
@@ -96,7 +96,7 @@ ${BOOT1}.efi: ${PROG}
exit 1; \
fi
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
${EFI_OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
-j .dynamic -j .dynsym -j .rel.dyn \
-j .rela.dyn -j .reloc -j .eh_frame \
--output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
+1 -1
View File
@@ -128,7 +128,7 @@ ${LOADER}.efi: ${PROG}
exit 1; \
fi
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
${EFI_OBJCOPY} -j .peheader -j .text -j .sdata -j .data \
-j .dynamic -j .dynsym -j .rel.dyn \
-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
-j set_X${LOADER_INTERP}_compile_set \