Created attachment 916258 [details] Build log sys-boot/gnu-efi fails to build if `OBJCOPY` in make.conf is set to absolute path of `llvm-objcopy`. In https://bugs.gentoo.org/931792 there was a fix which forced use of binutils objcopy. However it works only with simple cases (like OBJCOPY=llvm-objcopy). Step-by-step transformations in the current sys-boot/gnu-efi-4.0.0 ebuild: Step 1: OBJCOPY="${OBJCOPY/llvm-/}" # replaces /usr/lib/llvm/19/bin/llvm-objcopy with /usr/lib/llvm/19/bin/objcopy Step 2: LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' && return 0 # fails as it is still llvm objcopy Step 3: local binutils_objcopy="${EPREFIX}"/usr/bin/"${OBJCOPY}" if [[ -e "${binutils_objcopy}" ]]; then OBJCOPY="${binutils_objcopy}" fi # does nothing as /usr/bin//usr/lib/llvm/19/bin/objcopy does not exist Step 4: LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target" # fails here with /usr/lib/llvm/19/bin/objcopy (objcopy) does not support EFI target Proposed fix: On step 3 use basename for OBJCOPY: local binutils_objcopy="${EPREFIX}/usr/bin/$(basename "$OBJCOPY")"
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee2d946961fb7174ffee8f5de8c75eacd982779e commit ee2d946961fb7174ffee8f5de8c75eacd982779e Author: Viorel Munteanu <ceamac@gentoo.org> AuthorDate: 2025-02-18 17:38:40 +0000 Commit: Viorel Munteanu <ceamac@gentoo.org> CommitDate: 2025-02-18 17:40:10 +0000 sys-boot/gnu-efi: another fix for OBJCOPY Try to simplify wrong objcopy handling. Bug: https://bugs.gentoo.org/947826 Signed-off-by: Viorel Munteanu <ceamac@gentoo.org> sys-boot/gnu-efi/gnu-efi-4.0.0.ebuild | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
Please check. If all goes well I'll backport this fix to 3.0.19 and stabilize it.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6da80af796482d9cd13a47180061fca9a8c66ad commit f6da80af796482d9cd13a47180061fca9a8c66ad Author: Viorel Munteanu <ceamac@gentoo.org> AuthorDate: 2025-03-22 08:58:58 +0000 Commit: Viorel Munteanu <ceamac@gentoo.org> CommitDate: 2025-03-22 14:52:26 +0000 sys-boot/gnu-efi: simplify OBJCOPY handling Copy it from sys-boot/gnu-efi-4.0.0. Closes: https://bugs.gentoo.org/947826 Signed-off-by: Viorel Munteanu <ceamac@gentoo.org> sys-boot/gnu-efi/gnu-efi-3.0.19.ebuild | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)