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

Bug 831478

Summary: toolchain-funcs: tc-ld-is-gold() returns true when ld.mold is used
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: EclassesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 830404    

Description Michael Orlitzky gentoo-dev 2022-01-19 14:02:03 UTC
The tc-ld-is-gold() function checks the --version output from the linker against the pattern *"GNU gold"* to see if it's ld.gold. But,

  $ ld.mold --version
  mold 1.0.1 (compatible with GNU ld and GNU gold)

Cruel, but legal I guess.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-20 02:50:11 UTC
Obsolete with https://github.com/rui314/mold/commit/cea6a569afa544826c91fda7ef0f9941f50c9459 (not in a release yet), I think.
Comment 2 Michael Orlitzky gentoo-dev 2022-01-20 04:01:20 UTC
(In reply to Sam James from comment #1)
> Obsolete with
> https://github.com/rui314/mold/commit/
> cea6a569afa544826c91fda7ef0f9941f50c9459 (not in a release yet), I think.

Ah, good. I wish "GNU ld" were removed too, but this solves the immediate problem. Should we backport it to mold-1.0.1? For now it's mainly causing problems with Qt, since qt5-build.eclass does,

  $(tc-ld-is-gold && echo -use-gold-linker || echo -no-use-gold-linker)

and that doesn't work so well without gold installed.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-20 05:53:26 UTC
(In reply to Michael Orlitzky from comment #2)
> (In reply to Sam James from comment #1)
> > Obsolete with
> > https://github.com/rui314/mold/commit/
> > cea6a569afa544826c91fda7ef0f9941f50c9459 (not in a release yet), I think.
> 
> Ah, good. I wish "GNU ld" were removed too, but this solves the immediate
> problem. Should we backport it to mold-1.0.1? For now it's mainly causing
> problems with Qt, since qt5-build.eclass does,
> 
>   $(tc-ld-is-gold && echo -use-gold-linker || echo -no-use-gold-linker)
> 
> and that doesn't work so well without gold installed.

Fine with me! Would you mind doing it? I'm currently playing with a new machine :)
Comment 4 Larry the Git Cow gentoo-dev 2022-01-20 14:40:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ad0c179fe9c6c5cbfe3edde28f2759386675bb1

commit 5ad0c179fe9c6c5cbfe3edde28f2759386675bb1
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2022-01-20 14:37:42 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2022-01-20 14:40:30 +0000

    sys-devel/mold: new revision sans "GNU gold" in --version.
    
    The new mold-1.0.1-r1 includes upstream commit cea6a569afa5 which
    removes the string "GNU gold" from mold's --version string. This is
    necessary on Gentoo to prevent false positives from tc-ld-is-gold() in
    the toolchain-funcs eclass.
    
    Closes: https://bugs.gentoo.org/831478
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 .../mold/files/mold-1.0.1-no-gold-in-version.patch | 50 ++++++++++++++++++++++
 .../{mold-1.0.1.ebuild => mold-1.0.1-r1.ebuild}    |  4 +-
 2 files changed, 53 insertions(+), 1 deletion(-)