Summary: | <sys-devel/gcc-11.2.1_p20211127: fails to build sys-libs/glibc-2.34-r1 (libc.a(inet_addr.o): TLS transition from R_386_TLS_GOTIE to R_386_TLS_LE_32 against `__libc_tsd_CTYPE_B' at 0xf4 in section `.text' failed) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Andrew Udvare <audvare> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | herrtimson, paolo.pedroni, sam, stylinae, volkov, zx2c4 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
URL: | https://www.sourceware.org/bugzilla/show_bug.cgi?id=28595 | ||
See Also: |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103275 https://bugs.gentoo.org/show_bug.cgi?id=830745 https://www.sourceware.org/bugzilla/show_bug.cgi?id=28595 |
||
Whiteboard: | Bug in GCC 11. Fixed in gcc-11.2.1_p20211127. | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 833357 | ||
Bug Blocks: | 732706, 803482 | ||
Attachments: |
build log
A patch for glibc-2.34-r2.ebuild to fix the issue Gcc 11 patch for root cause emerge info |
Description
Andrew Udvare
2021-11-15 00:27:36 UTC
Created attachment 751186 [details]
build log
This is interesting. I hit this on *one* machine of mine with only GCC 11, and GCC 10 worked. I assumed I'd broken something because I'd not seen it anywhere else at all. (In reply to Sam James from comment #2) > This is interesting. > > I hit this on *one* machine of mine with only GCC 11, and GCC 10 worked. I > assumed I'd broken something because I'd not seen it anywhere else at all. binutiils-9999 (I don't recommend trying this, I was just curious) at commit https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=da7ee7f9ce2fc8c278a46e0b360d44319a5a1e7a fails too. I tried the tip of the gcc 11 branch upstream too about 2 weeks ago which didn't help. I also hit this bug on machine with CFLAGS -march=tigerlake I tried with: -march=tigerlake - ERROR -march=cooperlake - ERROR -march=cascadelake - ERROR -march=cannonlake - ERROR -march=skylake-avx512 - ERROR -march=skylake - OK Switching to -march=skylake solves this. It looks like avx512 related bug. (In reply to Andrey Volkov from comment #4) > I also hit this bug on machine with CFLAGS -march=tigerlake > > I tried with: > > -march=tigerlake - ERROR > -march=cooperlake - ERROR > -march=cascadelake - ERROR > -march=cannonlake - ERROR > -march=skylake-avx512 - ERROR > -march=skylake - OK > > Switching to -march=skylake solves this. > It looks like avx512 related bug. This matches exactly with my experience. The one box I can hit this on is Tiger Lake. Thanks for investigating a bit more... (In reply to Sam James from comment #5) > (In reply to Andrey Volkov from comment #4) > > I also hit this bug on machine with CFLAGS -march=tigerlake > > > > I tried with: > > > > -march=tigerlake - ERROR > > -march=cooperlake - ERROR > > -march=cascadelake - ERROR > > -march=cannonlake - ERROR > > -march=skylake-avx512 - ERROR > > -march=skylake - OK > > > > Switching to -march=skylake solves this. > > It looks like avx512 related bug. > > This matches exactly with my experience. The one box I can hit this on is > Tiger Lake. Thanks for investigating a bit more... I ran ebuild with -march=skylake and it builds for me. 11900K is Rocket Lake. env CFLAGS="-ggdb -march=skylake -pipe -O2" ebuild /var/db/repos/gentoo/sys-libs/glibc/glibc-2.34-r1.ebuild install *** Bug 823850 has been marked as a duplicate of this bug. *** This is also being tracked on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103275 A more minimal workaround is to add `-mno-avx512f` to your CFLAGS. Created attachment 751682 [details, diff]
A patch for glibc-2.34-r2.ebuild to fix the issue
This is a quick and easy fix that should suffice until gcc releases something real. It has minimal impact on performance by only affecting the -m32 build but not the -m64 one. The gcc bug is only triggered, for glibc, in -m32 mode.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=876602ee223c6c4225371b428a346f0b2d7f2020 commit 876602ee223c6c4225371b428a346f0b2d7f2020 Author: Jason A. Donenfeld <zx2c4@gentoo.org> AuthorDate: 2021-11-16 23:30:13 +0000 Commit: Jason A. Donenfeld <zx2c4@gentoo.org> CommitDate: 2021-11-16 23:33:44 +0000 sys-libs/glibc: add -mno-avx512f to -m32 build for gcc 11 bug No need to revbump as this only affects folks who cannot currently compile. Closes: https://bugs.gentoo.org/823780 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org> sys-libs/glibc/glibc-2.34-r2.ebuild | 8 ++++++++ 1 file changed, 8 insertions(+) Let’s keep it open so we backport the relevant fixes. Okay there's now a gcc 11 patch available: https://gcc.gnu.org/g:eb8ff3cbc09e029ca0cbd0d8b09bcaba162ab95a We should pick this into our gcc 11.2 ebuild, and then drop my temporary workaround in glibc. (The related binutils assembler fix just causes the assembler to error out so that the linker doesn't do the same later on. Since it's just moving the error to the more proper place, we probably don't need to backport it. Instead we can simply address the root cause with the gcc patch.) Created attachment 755054 [details, diff]
Gcc 11 patch for root cause
(In reply to Jason A. Donenfeld from comment #12) > Okay there's now a gcc 11 patch available: > https://gcc.gnu.org/g:eb8ff3cbc09e029ca0cbd0d8b09bcaba162ab95a > > We should pick this into our gcc 11.2 ebuild, and then drop my temporary > workaround in glibc. Yeah, absolutely. So, there's two decisions to make: 1. Do we revbump with it? We probably should as it affects code generation (it's not a gcc build failure) and we're kind of fortunate that the linker the issue. The case _against_ is that GCC 11.3 is hopefully soon? 2. If we're revbumping anyway, should we just include a rollup of the gcc-11 branch (which we're due and I've been planning on us doing)? I'm happy for us to do this, but if GCC 11.3 is going to come out next week, it's a bit cruel for users to have two GCC rebuilds in a short period. I think it comes down to whether we can find out when GCC 11.3 is planned. If it's very soon, we'll wait. If not, we'll probably do a rollup of the backport branch. I think your analysis makes sense. "Yes" and "yes", unless gcc 11.3 is around the corner for real. There were about 9 months between 10.2 and 10.3, and 11.2 was released about 4 months ago. I don't know how valid the extrapolation is though. Just to keep this bug updated: asking maintainers, it seems like there's likely no gcc update coming up for a long while. So we can move ahead with the roll-up. (In reply to Jason A. Donenfeld from comment #17) > Just to keep this bug updated: asking maintainers, it seems like there's > likely no gcc update coming up for a long while. So we can move ahead with > the roll-up. We will likely cut straight from the 11 tree. Give us a few days. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89a6a8647d74612648f0502baa27660008cc256c commit 89a6a8647d74612648f0502baa27660008cc256c Author: Sam James <sam@gentoo.org> AuthorDate: 2021-11-27 23:47:10 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-11-27 23:47:27 +0000 sys-libs/glibc: don't apply GCC 11 AVX512 workaround to upcoming patch release Bug: https://bugs.gentoo.org/823780 Signed-off-by: Sam James <sam@gentoo.org> sys-libs/glibc/glibc-2.34-r2.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c397cbff26bf100ae36eefe886497e8238e53515 Author: David Seifert <soap@gentoo.org> Date: Sun Nov 28 00:04:10 2021 +0100 sys-devel/gcc: add 11.2.1_p20211127 upstream has indicated that 11.3 is unlikely to be released soon, and 11.2 has accumulated enough bugs to require an intermediate release for Gentoo. Bug: https://bugs.gentoo.org/806482 Bug: https://bugs.gentoo.org/811867 Bug: https://bugs.gentoo.org/823780 Signed-off-by: David Seifert <soap@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org> Created attachment 760134 [details]
emerge info
(In reply to Geoff Madden from comment #21) > Created attachment 760134 [details] > emerge info You shouldn't be hitting this issue anymore? Please upgrade GCC. On my machine glibc would not compile against gcc-11.2.1_p20211127,kept falling over with a similar msg. My remedy was to drop back to gcc-11.2.0 ,recompile @world,then update glibc-2.34-r4 successfully. Hope this helps over the holiday season. Best wishes to all & a great New Year (In reply to Geoff Madden from comment #23) > On my machine glibc would not compile against gcc-11.2.1_p20211127,kept > falling over with a similar msg. > My remedy was to drop back to gcc-11.2.0 ,recompile @world,then update > glibc-2.34-r4 successfully. > Hope this helps over the holiday season. > Best wishes to all & a great New Year That sounds reaaaaaally odd. Nobody else has reported it and it seemed definitively fixed. Could you share the build.log from it failing with gcc-11.2.1_p20211127 then emerge -v1 glibc? (In reply to Sam James from comment #24) > > Hope this helps over the holiday season. > > Best wishes to all & a great New Year > (and best wishes to you too, of course!) *** Bug 830745 has been marked as a duplicate of this bug. *** Do we need a newer gcc stable? Fixed GCC is stable on amd64 and this only affected that arch. Closing. Note that technically Binutils 2.38 is needed for the other fix too. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fd2400c18a36b8aad51328b3731fef55968e4fc commit 4fd2400c18a36b8aad51328b3731fef55968e4fc Author: Sam James <sam@gentoo.org> AuthorDate: 2022-08-20 00:31:21 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-08-20 00:32:36 +0000 sys-libs/glibc: restore GCC < 11.2.1_p* AVX512 sanity check It's cheap and it avoids build failures, so why not? Only really affects Tiger Lake or so though. Fixed in newer GCCs anyway. Bug: https://bugs.gentoo.org/823780 Signed-off-by: Sam James <sam@gentoo.org> sys-libs/glibc/glibc-2.35-r8.ebuild | 6 ++++++ sys-libs/glibc/glibc-2.36.ebuild | 6 ++++++ sys-libs/glibc/glibc-9999.ebuild | 6 ++++++ 3 files changed, 18 insertions(+) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1503e65c800f54cadb6c2503ce839d1dbcf3ceef commit 1503e65c800f54cadb6c2503ce839d1dbcf3ceef Author: Sam James <sam@gentoo.org> AuthorDate: 2024-06-12 23:27:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-06-12 23:27:30 +0000 sys-libs/glibc: drop old AVX512 workaround Bug: https://bugs.gentoo.org/823780 Signed-off-by: Sam James <sam@gentoo.org> sys-libs/glibc/glibc-2.39-r9.ebuild | 10 ---------- sys-libs/glibc/glibc-9999.ebuild | 10 ---------- 2 files changed, 20 deletions(-) |