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

Bug 843119

Summary: sys-devel/gcc[nls]: failure when building older GCC with newer GCC (msgfmt: symbol lookup error: /usr/lib/libicuuc.so.68: undefined symbol: _ZSt14__once_functor, version GLIBCXX_3.4.11)
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: admnd, dflogeras2, lebkoungcity, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=295480
https://bugs.gentoo.org/show_bug.cgi?id=372377
https://bugs.gentoo.org/show_bug.cgi?id=841955
https://bugs.gentoo.org/show_bug.cgi?id=867196
https://bugs.gentoo.org/show_bug.cgi?id=886447
https://bugs.gentoo.org/show_bug.cgi?id=892816
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge-info.txt
emerge-history.txt
environment
etc.portage.tar.bz2
logs.tar.bz2
sys-devel:gcc-10.3.1_p20211126:20220507-035622.log.bz2
temp.tar.bz2

Description Toralf Förster gentoo-dev 2022-05-07 09:01:38 UTC
x86_64-pc-linux-gnu-gcc -c -DHAVE_CONFIG_H -pipe -march=native -fno-diagnostics-color -O2  -I. -I/var/tmp/portage/sys-devel/gcc-10.3.1_p20211126/work/gcc-10-20211126/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE  /var/tmp/portage/sys-devel/gcc-10.3.1_p20211126/work/gcc-10-20211126/libiberty/vprintf-support.c -o vprintf-support.o
yes
checking for objcopy... objcopy
checking for readelf... x86_64-pc-linux-gnu-readelf
checking whether objcopy supports debuglink... objcopy: /tmp/ls12584: cannot fill debug link section `x': No such file or directory
no
checking whether tests can run... if [ x"" != x ]; then \

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_plasma_systemd-j4-20220504-230005

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-12.0.1 *
clang/llvm (if any):
clang version 14.0.3
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/14/bin
/usr/lib/llvm/14
14.0.3
Python 3.9.12
Available Ruby profiles:
  [1]   ruby26 (with Rubygems)
  [2]   ruby27 (with Rubygems)
  [3]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.60.0
  [2]   rust-1.60.0 *
The following VMs are available for generation-2:
*)	Eclipse Temurin JDK 11.0.14_p9 [openjdk-bin-11]
2)	Eclipse Temurin JDK 8.322_p06 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-11  system-vm

The Glorious Glasgow Haskell Compilation System, version 8.10.4
php cli:
  [1]   php7.4
  [2]   php8.0
  [3]   php8.1 *

  HEAD of ::gentoo
commit b039deea1020186ddab0b842d4b1ba66ce7c03c7
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat May 7 03:18:24 2022 +0000

    2022-05-07 03:18:23 UTC

emerge -qpvO sys-devel/gcc
[ebuild  NS   ] sys-devel/gcc-10.3.1_p20211126 [12.0.1_pre20220430] USE="(cxx) fortran (multilib) nls nptl openmp pch* (pie) sanitize ssp (-ada) (-cet) -d -debug -doc (-fixed-point) -go -graphite (-hardened) -jit (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla -vtv -zstd (-custom-cflags%) (-valgrind%)"
Comment 1 Toralf Förster gentoo-dev 2022-05-07 09:01:39 UTC
Created attachment 777239 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-05-07 09:01:41 UTC
Created attachment 777242 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2022-05-07 09:01:42 UTC
Created attachment 777245 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-05-07 09:01:43 UTC
Created attachment 777248 [details]
etc.portage.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-05-07 09:01:45 UTC
Created attachment 777251 [details]
logs.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-05-07 09:01:46 UTC
Created attachment 777254 [details]
sys-devel:gcc-10.3.1_p20211126:20220507-035622.log.bz2
Comment 7 Toralf Förster gentoo-dev 2022-05-07 09:01:47 UTC
Created attachment 777257 [details]
temp.tar.bz2
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-22 22:15:53 UTC
This is unfixable, pretty much. It's because gettext (msgfmt) is linked with libxml2 which is linked with ICU which here has been built with libstdc++ from a newer GCC (12 here).

You can workaround with USE="-nls" but it's the same thing as trying to downgrade GCC in general: https://wiki.gentoo.org/wiki/Upgrading_GCC#Downgrading_GCC.
Comment 9 Matthias Maier gentoo-dev 2022-06-02 16:12:56 UTC
*** Bug 843107 has been marked as a duplicate of this bug. ***
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-04 08:20:53 UTC
(In reply to Sam James from comment #8)
> This is unfixable, pretty much. It's because gettext (msgfmt) is linked with
> libxml2 which is linked with ICU which here has been built with libstdc++
> from a newer GCC (12 here).
> 
> You can workaround with USE="-nls" but it's the same thing as trying to
> downgrade GCC in general:
> https://wiki.gentoo.org/wiki/Upgrading_GCC#Downgrading_GCC.

I think I was slightly brash here: I don't think LD_LIBRARY_PATH should necessarily be set for the gettext calls to e.g. msgfmt.

But it's somewhat low priority given the above and it has a workaround.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-05 04:44:18 UTC
*** Bug 776733 has been marked as a duplicate of this bug. ***
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-02 13:18:18 UTC
*** Bug 855611 has been marked as a duplicate of this bug. ***
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-03 00:53:48 UTC
Heh, we did actually have a patch for this in the past!

$ find . | grep -i msgfmt | sort
./4.7.4/gentoo/20_all_msgfmt-libstdc++-link.patch
./4.8.4/gentoo/20_all_msgfmt-libstdc++-link.patch
./4.8.5/gentoo/20_all_msgfmt-libstdc++-link.patch
./4.9.2/gentoo/20_all_msgfmt-libstdc++-link.patch
./4.9.3/gentoo/20_all_msgfmt-libstdc++-link.patch
./4.9.4/gentoo/20_all_msgfmt-libstdc++-link.patch
./5.1.0/gentoo/20_all_msgfmt-libstdc++-link.patch
./5.2.0/gentoo/20_all_msgfmt-libstdc++-link.patch
./5.3.0/gentoo/20_all_msgfmt-libstdc++-link.patch
./5.4.0/gentoo/20_all_msgfmt-libstdc++-link.patch
./5.5.0/gentoo/06_all_msgfmt-libstdc++-link.patch

We just need to bring it up to date.
Comment 14 Larry the Git Cow gentoo-dev 2022-07-03 02:19:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93868fad1ad8671a100060a34e3de0238d2fd865

commit 93868fad1ad8671a100060a34e3de0238d2fd865
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-03 02:19:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-03 02:19:06 +0000

    sys-devel/gcc: fix USE=nls w/ newer GCC for 12.1.1*
    
    Not that it really matters here for now, hence not doing 12.1.0 etc.
    
    Bug: https://bugs.gentoo.org/843119
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                    | 1 +
 sys-devel/gcc/gcc-12.1.1_p20220702.ebuild | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a57e9564140ad377454ea6f6be9369ac05c0732

commit 6a57e9564140ad377454ea6f6be9369ac05c0732
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-03 02:10:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-03 02:10:51 +0000

    sys-devel/gcc: fix USE=nls w/ newer GCC for 11.{3,4}.0
    
    Bug: https://bugs.gentoo.org/843119
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                                       | 2 ++
 sys-devel/gcc/gcc-11.3.0.ebuild                              | 2 +-
 sys-devel/gcc/gcc-11.3.1_p20220701.ebuild                    | 2 +-
 sys-devel/gcc/{gcc-11.4.9999.ebuild => gcc-11.3.9999.ebuild} | 0
 4 files changed, 4 insertions(+), 2 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=294855c97d8d182b59d0fc34ac721d6a2358fb87

commit 294855c97d8d182b59d0fc34ac721d6a2358fb87
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-03 01:50:28 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-03 01:50:41 +0000

    sys-devel/gcc: fix USE=nls w/ newer GCC for 10.4.0
    
    Bug: https://bugs.gentoo.org/843119
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest          | 1 +
 sys-devel/gcc/gcc-10.4.0.ebuild | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Comment 15 Larry the Git Cow gentoo-dev 2022-07-03 02:22:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=1a5882abf01ae085e999ddcf4d208105e21e1a0d

commit 1a5882abf01ae085e999ddcf4d208105e21e1a0d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-03 02:03:18 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-03 02:22:11 +0000

    10.4.0, 11.3.0, 11.4.0, 12.1.0: add gettext/msgfmt libstdc++ patch
    
    Fixes building w/ USE=nls using a newer GCC.
    
    Bug: https://bugs.gentoo.org/843119
    Signed-off-by: Sam James <sam@gentoo.org>

 10.4.0/gentoo/33_all_msgfmt-libstdc++-link.patch | 39 ++++++++++++++++++++++++
 10.4.0/gentoo/README.history                     |  3 ++
 11.3.0/gentoo/27_all_msgfmt-libstdc++-link.patch | 39 ++++++++++++++++++++++++
 11.3.0/gentoo/README.history                     |  3 ++
 11.4.0/gentoo/27_all_msgfmt-libstdc++-link.patch | 39 ++++++++++++++++++++++++
 11.4.0/gentoo/README.history                     |  3 ++
 12.1.0/gentoo/29_all_msgfmt-libstdc++-link.patch | 39 ++++++++++++++++++++++++
 12.1.0/gentoo/README.history                     |  3 ++
 8 files changed, 168 insertions(+)
Comment 16 Larry the Git Cow gentoo-dev 2022-10-01 04:24:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6fb906ef2da01327d64cea263887ef34c97c1bbf

commit 6fb906ef2da01327d64cea263887ef34c97c1bbf
Author:     Alfredo Tupone <tupone@gentoo.org>
AuthorDate: 2022-09-18 07:15:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-30 00:13:22 +0000

    10.3.0: backport glibc 2.36, gettext/msgfmt patch from 10.4.0
    
    Bug: https://bugs.gentoo.org/295480
    Bug: https://bugs.gentoo.org/372377
    Bug: https://bugs.gentoo.org/843119
    Bug: https://bugs.gentoo.org/864717
    Bug: https://bugs.gentoo.org/865879
    Closes: https://github.com/gentoo/gcc-patches/pull/2
    Signed-off-by: Sam James <sam@gentoo.org>

 10.3.0/gentoo/36_all_msgfmt-libstdc++-link.patch | 39 ++++++++++++++
 10.3.0/gentoo/37_all_glibc_236.patch             | 68 ++++++++++++++++++++++++
 10.3.0/gentoo/README.history                     |  4 ++
 3 files changed, 111 insertions(+)
Comment 17 Mike Gilbert gentoo-dev 2023-02-04 19:39:30 UTC
*** Bug 892816 has been marked as a duplicate of this bug. ***