Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 732256

Summary: sys-boot/refind-0.12.0 - llvm-objcopy: error: invalid output format: 'efi-bsdrv-x86_64' / 'efi-app-x86_64'
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Viorel Munteanu <ceamac>
Status: RESOLVED WONTFIX    
Severity: normal CC: proxy-maint, sveyret
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/32710
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 408963    
Attachments: build.log

Description Agostino Sarubbo gentoo-dev 2020-07-11 19:11:19 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-boot/refind fails to compile.
Discovered on: amd64  (internal ref: tinderbox)

NOTE:
This machine uses a clang/LLVM toolchain.
If you think that this issue is strictly related to clang/LLVM please block bug 408963. If you think that this issue isstrictly related to the LLD linker, please block bug 731004.
Comment 1 Agostino Sarubbo gentoo-dev 2020-07-11 19:11:25 UTC
Created attachment 648938 [details]
build.log

build log and emerge --info
Comment 2 Stéphane Veyret 2021-04-05 15:34:13 UTC
This version was known to not compile with GCC 10 (https://bugs.gentoo.org/723244). Have you tested with the latest versions ?
Comment 3 Manuel Nickschas 2021-06-29 10:13:51 UTC
I can confirm that this issue still persists with GCC 11.1.0 / Clang 12 on a system (almost) fully built with Clang.

refind does not compile with Clang in the first place due to unsupported compiler options, but even after switching to GCC, llvm-objcopy fails with the error messages mentioned in this bug. Setting OBJCOPY="objcopy" in the ebuild's environment makes it work.

I'll block bug #408963 accordingly.
Comment 4 Manuel Nickschas 2021-06-29 10:16:18 UTC
Actually, it seems that I can't add a blocks/depends-on relationship as a mere user, or I'm too stupid with Bugzilla ;-)
Comment 5 Larry the Git Cow gentoo-dev 2023-09-14 04:43:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=797977a54c63876d010635d5d8431798396e9b15

commit 797977a54c63876d010635d5d8431798396e9b15
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2023-09-10 12:29:17 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2023-09-14 04:39:01 +0000

    sys-boot/refind: fix compilation with clang
    
    Compiling with clang works.
    Linking with lld produces broken executables (including the drivers).
    llvm-objcopy does not support the output format needed by refind.
    
    Try to force ld.bfd and binutils objcopy.  Fail otherwise.
    
    Bug: https://bugs.gentoo.org/732256
    Bug: https://bugs.gentoo.org/832018
    Bug: https://bugs.gentoo.org/881131
    Closes: https://github.com/gentoo/gentoo/pull/32710
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 sys-boot/refind/files/refind-0.14.0.2-clang.patch |  62 +++++++++
 sys-boot/refind/refind-0.14.0.2-r1.ebuild         | 160 ++++++++++++++++++++++
 2 files changed, 222 insertions(+)