Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 892339 - sys-apps/fwupd-efi-1.4 calls linker by ID rather than executable name
Summary: sys-apps/fwupd-efi-1.4 calls linker by ID rather than executable name
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Marek Szuba
URL: https://github.com/fwupd/fwupd-efi/is...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-28 07:11 UTC by Agostino Sarubbo
Modified: 2023-02-27 13:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,44.83 KB, text/plain)
2023-01-28 07:11 UTC, Agostino Sarubbo
Details
1-meson-log.txt (1-meson-log.txt,9.87 KB, text/plain)
2023-01-28 07:11 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-01-28 07:11:00 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-apps/fwupd-efi-1.4 calls ld directly.
Discovered on: amd64 (internal ref: ci)

NOTE:
As per QA policy, toolchain tools must not be called directly because they can cause issue in cross-compiling and because is not possible use a different LD implementation (like llvm-link). To reproduce, please use sys-devel/gcc-config[-native-symlinks], sys-devel/binutils-config[-native-symlinks].
Comment 1 Agostino Sarubbo gentoo-dev 2023-01-28 07:11:02 UTC
Created attachment 849317 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2023-01-28 07:11:03 UTC
Created attachment 849319 [details]
1-meson-log.txt

1-meson-log.txt
Comment 3 Agostino Sarubbo gentoo-dev 2023-01-28 07:11:05 UTC
Error(s) that match a know pattern:


efi/meson.build:226:0: ERROR: Program 'ld.bfd' not found or not executable
efi/meson.build:90: WARNING: Cannot find SBAT section in /usr/lib64/elf_x86_64_efi.lds, using local copy
Program genpeimg found: NO
Comment 4 Marek Szuba archtester gentoo-dev 2023-02-02 09:42:32 UTC
The problem here is not that the build scripts call ld directly (looking at src_configure output in build.log shows that meson has correctly identified the linker as x86_64-pc-linux-gnu-gcc as specified in LD) but rather, that it assumes the chosen linker can be called by an executable whose name matches the linker ID - ld.bfd in this case. This outright breaks on systems where such symlinks are not created (as shown here), and might invoke an incorrect linker on systems where they do exist.

Still, something will have to be done about it. I reckon that unless upstream comes with a proper fix soon, I'll just reinstate the old approach of having a Meson option to specify the linker.
Comment 5 Larry the Git Cow gentoo-dev 2023-02-27 13:15:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e68014936059256d40d745a4e60dd46aeca52f9

commit 3e68014936059256d40d745a4e60dd46aeca52f9
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-02-27 12:53:56 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-02-27 13:15:23 +0000

    sys-apps/fwupd-efi: restore the old option for setting the linker
    
    Between 1.3 and 1.4, fwupd-efi upstream phased this option out in favour
    of using standard Meson toolchain management for both the compiler and
    the linker. However, the transition has not been completed yet and
    the linking phase still involves a custom target explicitly calling the
    linker executable - and the way the name of said executable is
    determined at the moment is not entirely robust.
    
    Closes: https://bugs.gentoo.org/892339
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 .../files/fwupd-efi-1.4-efi_ld_override.patch      | 26 ++++++++++++++++++++++
 sys-apps/fwupd-efi/fwupd-efi-1.4.ebuild            |  7 +++++-
 2 files changed, 32 insertions(+), 1 deletion(-)