Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 852092 - sys-libs/glibc-2.35-r5 and later: something with PATCHVER=7 and PATCHVER=8 is breaking compatibility with the LLD linker
Summary: sys-libs/glibc-2.35-r5 and later: something with PATCHVER=7 and PATCHVER=8 is...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: LD-is-lld, systemwide-lld
  Show dependency tree
 
Reported: 2022-06-15 07:46 UTC by unhappy-ending
Modified: 2022-11-13 00:42 UTC (History)
3 users (show)

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


Attachments
glibc-2.35-r4 patch list (glibc-2.35-r4-patches.txt,27.36 KB, text/plain)
2022-06-15 07:47 UTC, unhappy-ending
Details
glibc-2.35-r5 patch list (glibc-2.35-r5-patches.txt,27.36 KB, text/plain)
2022-06-15 07:48 UTC, unhappy-ending
Details
glibc-2.35-r7[vanilla] successful build log (glibc-2.35-r7:20220615-070717.tar.gz,615.94 KB, application/gzip)
2022-06-15 07:51 UTC, unhappy-ending
Details
glibc-2.35-r7[-vanilla] failure build log (glibc-2.35-r7:20220615-071810.tar.gz,169.04 KB, application/gzip)
2022-06-15 07:52 UTC, unhappy-ending
Details
glibc-2.35-r4[-vanilla] successful build log (glibc-2.35-r4:20220615-075031.tar.gz,616.38 KB, application/gzip)
2022-06-15 07:53 UTC, unhappy-ending
Details
glibc-2.35-r7[-vanilla] successful build log with -fuse-ld=bfd (glibc-2.35-r7:20220615-075845.tar.gz,618.22 KB, application/gzip)
2022-06-15 08:02 UTC, unhappy-ending
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unhappy-ending 2022-06-15 07:46:20 UTC
As summarized, LLD compatibility is broken somewhere in the Gentoo patch series starting at 7. Glibc 2.35 introduced compatibility with LLD 13 and should be capable of building. When disabling the Gentoo patch series by unmasking and using the vanilla USE flag, glibc-2.35-r5 and later are capable of being built.


Reproducible: Always

Steps to Reproduce:
1. LDFLAGS="-fuse-ld=lld"
2. Try to compile glibc-2.35-r5 or later
3. Failure

1. Unmask and enable USE="vanilla"
2. LDFLAGS="-fuse-ld=lld"
3. Try to compile glibc-2.35-r5 and later
4. Success
Actual Results:  
With Gentoo patch version 7, results in failure.

Expected Results:  
Expected results are for glibc-2.35 to build with LLD, which is the behavior witnessed with USE="vanilla"

I'm not sure what insights I can provide. The glibc ebuild system is way above my head. I've gone into glibc-2.35-r4's working directory and the patch list is identical to glibc-2.35-r5's patch list. To be sure I've ran an ebuild clean configure on both and output to different text files, ran a diff and the only things different are the versions, not the names or lists of patches.
Comment 1 unhappy-ending 2022-06-15 07:47:39 UTC
Created attachment 785189 [details]
glibc-2.35-r4 patch list

Including output of glibc-2.35-r4 patch list to show it's identical to glibc-2.35-r5
Comment 2 unhappy-ending 2022-06-15 07:48:05 UTC
Created attachment 785192 [details]
glibc-2.35-r5 patch list

Including output of glibc-2.35-r5 patch list to show it's identical to glibc-2.35-r4
Comment 3 unhappy-ending 2022-06-15 07:51:28 UTC
Created attachment 785195 [details]
glibc-2.35-r7[vanilla] successful build log

glibc-2.35-r7[vanilla] successful build log
Comment 4 unhappy-ending 2022-06-15 07:52:11 UTC
Created attachment 785198 [details]
glibc-2.35-r7[-vanilla] failure build log

Gentoo patched glibc-2.35-r7[-vanilla] failure build log
Comment 5 unhappy-ending 2022-06-15 07:53:21 UTC
Created attachment 785201 [details]
glibc-2.35-r4[-vanilla] successful build log

Gentoo patched glibc-2.35-r4[-vanilla] successful build log, prior to the start of failures with PATCHVER=7
Comment 6 unhappy-ending 2022-06-15 08:02:34 UTC
Created attachment 785204 [details]
glibc-2.35-r7[-vanilla] successful build log with -fuse-ld=bfd

Gentoo patched glibc-2.35-r7[-vanilla] successful build log with -fuse-ld=bfd, to show the breakage is when using -fuse-ld=lld and not something else.
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2022-07-30 17:31:51 UTC
Don't do that.

I'll try to find out if it was ever supposed to work, but in general glibc is (still) tightly coupled to gcc and gnu binutils.
Comment 8 unhappy-ending 2022-07-30 19:56:40 UTC
As of glibc 2.35 and LLD 13, glibc is supposed to be capable of linking with LLD. MaskRay, a LLD developer, worked with the glibc folks on this.

https://maskray.me/blog/2021-09-05-build-glibc-with-lld

He's also working with them to get Clang support as well, decoupling glibc from GCC & binutils.

FYI, from 2.35 to 2.35-r4, I was able to use a LLD linked glibc. It wasn't until 2.35-r5 that something on the Gentoo side of things broke it.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-31 02:01:50 UTC
(In reply to unhappy-ending from comment #8)
> As of glibc 2.35 and LLD 13, glibc is supposed to be capable of linking with
> LLD. MaskRay, a LLD developer, worked with the glibc folks on this.
> 
> https://maskray.me/blog/2021-09-05-build-glibc-with-lld
> 
> He's also working with them to get Clang support as well, decoupling glibc
> from GCC & binutils.
> 
> FYI, from 2.35 to 2.35-r4, I was able to use a LLD linked glibc. It wasn't
> until 2.35-r5 that something on the Gentoo side of things broke it.

We know, but clearly something broke, and it's not the garden path yet.

In any case, shouldn't block stabiilisation, I think was the point of dilf's comment. Doesn't mean it's invalid.
Comment 10 Andreas K. Hüttel archtester gentoo-dev 2022-11-12 21:03:12 UTC
Is 2.36 OK ?
Comment 11 unhappy-ending 2022-11-13 00:41:41 UTC
(In reply to Andreas K. Hüttel from comment #10)
> Is 2.36 OK ?

Yes, worse actually. Trying to build with LLD fails regardless of USE="vanilla" being set.
Comment 12 unhappy-ending 2022-11-13 00:42:50 UTC
(In reply to unhappy-ending from comment #11)
> (In reply to Andreas K. Hüttel from comment #10)
> > Is 2.36 OK ?
> 
> Yes, worse actually. Trying to build with LLD fails regardless of
> USE="vanilla" being set.

I meant no, not yes, lol!