Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705302 - =sys-devel/gcc-8.3.0-r3: ar: libstdc++.so.6: version 'GLIBCXX_3.4.26' not found (required by [some library])
Summary: =sys-devel/gcc-8.3.0-r3: ar: libstdc++.so.6: version 'GLIBCXX_3.4.26' not fou...
Status: RESOLVED DUPLICATE of bug 644772
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:
 
Reported: 2020-01-12 18:17 UTC by Bernd
Modified: 2020-01-13 06:51 UTC (History)
1 user (show)

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


Attachments
gcc-8.3.0-r3:20200112-173417.log.lzma (gcc-8.3.0-r3:20200112-173417.log.lzma,77.01 KB, application/octet-stream)
2020-01-12 18:21 UTC, Bernd
Details
emerge-info-gcc-8.3.0-r3.txt (emerge-info-gcc-8.3.0-r3.txt,13.80 KB, text/plain)
2020-01-12 18:24 UTC, Bernd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd 2020-01-12 18:17:56 UTC
The complete error message is like:

/usr/x86_64-pc-linux-gnu/bin/ar: /var/tmp/portage-ondisk/portage/sys-devel/gcc-8.3.0-r3/work/build/x86_64-pc-linux-gnu/libstdc++-v3/
src/.libs/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib64/libz3.so.4.8)

../libtool: line 1132: 85538 Segmentation fault      (core dumped) /usr/x86_64-pc-linux-gnu/bin/ar rc .libs/libstdc++.a [list of object files]

At an earlier build failure (dated at Jan 9) the library pointed to by the required by part inside the parens was /usr/lib/llvm/9/lib64/../lib64/libLLVMCodeGen.so.9, so I wouldn't count on the libz3 library having sth to do with this.

The error first popped up during my upgrade from amd64 to ~amd64, after an update from dev-libs/isl-0.21 to first isl-0.22 and stayed after updating to isl-0.22-r1 a few days later, but I'm not sure, it's related to this update.

Dmesg contains the lines
[199661.381024] ar[3307960]: segfault at 0 ip 00007f3307a0e9a3 sp 00007ffea53b1170 error 4 in libpthread-2.30.so[7f3307a0e000+13000]
[199661.381030] Code: 82 e8 02 00 00 e0 ff ff ff be 18 00 00 00 48 89 ba d8 02 00 00 48 89 ba e0 02 00 00 b8 11 01 00 00 0f 05 48 8b 05 15 86 01 00 <48> 8b 00 64 48 89 04 25 98 06 00 00 48 8d 05 ba c9 01 00 48 8d 8a
after the failure.


Reproducible: Always




I append build log and emerge --info as files.
Comment 1 Bernd 2020-01-12 18:21:12 UTC
Created attachment 603108 [details]
gcc-8.3.0-r3:20200112-173417.log.lzma

build log
Comment 2 Bernd 2020-01-12 18:24:24 UTC
Created attachment 603110 [details]
emerge-info-gcc-8.3.0-r3.txt

output of emerge --info
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-01-12 19:50:53 UTC
> ld GNU gold (Gentoo 2.33.1 p2 2.33.1) 1.16

I guess your GNU gold is linked against libstdc++ from gcc-9.2.0. While gcc-8.3.0 is build it attempts to use libstdc++ from just built gcc-8.3.0 and fails.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-01-12 20:07:54 UTC
Do you have sys-devel/llvmgold installed by chance?
Comment 5 Bernd 2020-01-12 20:33:20 UTC
It is as you say. But how can I the solve this? Binutils doesn't have a static USE flag, to temporarily disable dynamic linking against libstdc++. Also I tried using "LD=/usr/bin/ld.bfd emerge gcc:8.3.0" with no success.

Do I need to downgrade binutils to 2.32 and binutils-config to 5.1-r1, so I have the --linker flag to binutils-config and re-emerge gcc:9.2.0 using ld.bfd?
Comment 6 Bernd 2020-01-12 20:33:37 UTC
Yes, I have llvmgold installed
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-01-12 22:25:20 UTC
(In reply to Bernd from comment #5)
> Do I need to downgrade binutils to 2.32 and binutils-config to 5.1-r1, so I
> have the --linker flag to binutils-config and re-emerge gcc:9.2.0 using
> ld.bfd?

Note: the program that SIGSEGVs for you is not 'ld', but 'ar'.
Having --linker (or changing handling of ld) will have no no effect here.

sys-devel/llvmgold injects huge chunk of c++ code into every binutils binary via plugins mechanism: be it ar, ld, strip, etc.

> It is as you say. But how can I the solve this? Binutils doesn't have a
> static USE flag, to temporarily disable dynamic linking against libstdc++.
> Also I tried using "LD=/usr/bin/ld.bfd emerge gcc:8.3.0" with no success.

A few worlarounds that might work:
1. Uninstall sys-devel/llvmgold for a short time of rebuilding gcc. sys-devel/llvmgold only provides a symlink.
2. Rebuild sys-devel/binutils with USE=-plugins.

[1.] should be lightest way to do it.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-01-12 22:27:46 UTC

*** This bug has been marked as a duplicate of bug 644772 ***
Comment 9 Bernd 2020-01-13 06:51:09 UTC
Thanks, the first workaround did the job.