From 9b184c5de6bccb0c876592bb5fd9c654dbee8cc9 Mon Sep 17 00:00:00 2001 From: "Z. Liu" Date: Thu, 30 Oct 2025 14:09:33 +0800 Subject: [PATCH] app-crypt/efitools: fix building w/ llvm profile 1. ld.lld: error: section: .dynamic is not contiguous with other relro sections fix by force ld.bfd 2. llvm-objcopy: error: invalid output format: 'efi-app-x86_64' fix by force objcopy from binutils, check_and_set_objcopy is copied from sys-boot/gnu-efi Closes: https://bugs.gentoo.org/934377 Closes: https://bugs.gentoo.org/953401 Signed-off-by: Z. Liu Part-of: https://github.com/gentoo/gentoo/pull/44380 Closes: https://github.com/gentoo/gentoo/pull/44380 Signed-off-by: Viorel Munteanu --- app-crypt/efitools/efitools-1.9.2-r1.ebuild | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app-crypt/efitools/efitools-1.9.2-r1.ebuild b/app-crypt/efitools/efitools-1.9.2-r1.ebuild index 19832a9ca84ad..dfc140075e16d 100644 --- a/app-crypt/efitools/efitools-1.9.2-r1.ebuild +++ b/app-crypt/efitools/efitools-1.9.2-r1.ebuild @@ -26,6 +26,7 @@ BDEPEND=" app-crypt/sbsigntools dev-perl/File-Slurp sys-apps/help2man + sys-devel/binutils virtual/pkgconfig" PATCHES=( @@ -34,6 +35,35 @@ PATCHES=( "${FILESDIR}"/1.9.2-gcc15.patch ) +check_and_set_objcopy() { + if [[ ${MERGE_TYPE} != "binary" ]]; then + # bug #931792 + # llvm-objcopy does not support EFI target, try to use binutils objcopy or fail + tc-export OBJCOPY + OBJCOPY="${OBJCOPY/llvm-/}" + # Test OBJCOPY to see if it supports EFI targets, and return if it does + LC_ALL=C "${OBJCOPY}" --help | grep -q '\