Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 669194 - dev-libs/protobuf-3.6.1 with GOLD linker: `protoc --version`: terminate called after throwing an instance of 'std::system_error'
Summary: dev-libs/protobuf-3.6.1 with GOLD linker: `protoc --version`: terminate calle...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Arfrever Frehtes Taifersar Arahesis
URL:
Whiteboard:
Keywords:
: 669258 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-21 12:50 UTC by Jiří Moravec
Modified: 2019-08-07 07:22 UTC (History)
7 users (show)

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


Attachments
build.log (media-sound:clementine-1.3.1_p20180523:20181021-113034.log,98.99 KB, text/plain)
2018-10-21 12:52 UTC, Jiří Moravec
Details
emerge --info (emerge.info,7.29 KB, text/plain)
2018-10-23 15:51 UTC, Jiří Moravec
Details
strace protoc (protoc.strace,6.22 KB, text/plain)
2018-10-23 15:58 UTC, Jiří Moravec
Details
protobuf-3.6.0.1 ebuild patch (protobuf-3.6.0.1.ebuild.patch,301 bytes, patch)
2018-10-24 11:39 UTC, Jiří Moravec
Details | Diff
protobuf-3.6.1 ebuild patch (protobuf-3.6.1.ebuild.patch,297 bytes, patch)
2018-10-24 11:40 UTC, Jiří Moravec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Moravec 2018-10-21 12:50:33 UTC
media-sound/clementine-1.3.1_p20180523 failed to compile with dev-libs/protobuf-3.6.1, while there is no problem with dev-libs/protobuf-3.5.2.

part of build.log:

[  5%] Running C++ protocol buffer compiler on remotecontrolmessages.proto
cd /var/tmp/portage/media-sound/clementine-1.3.1_p20180523/work/clementine-1.3.1_p20180523_build/ext/libclementine-remote && /usr/bin/protoc --cpp_out=/var/tmp/portage/media-sound/clementine-1.3.1_p20180523/work/clementine-1.3.1_p20180523_build/ext/libclementine-remote -I /var/tmp/portage/media-sound/clementine-1.3.1_p20180523/work/Clementine-4619a4c1ab3b17b13d4b2327ad477912917eaf36/ext/libclementine-remote /var/tmp/portage/media-sound/clementine-1.3.1_p20180523/work/Clementine-4619a4c1ab3b17b13d4b2327ad477912917eaf36/ext/libclementine-remote/remotecontrolmessages.proto
terminate called after throwing an instance of 'std::system_error'
what():  Unknown error -1
make[2]: *** [ext/libclementine-spotifyblob/CMakeFiles/clementine-spotifyblob-messages.dir/build.make:63: ext/libclementine-spotifyblob/spotifymessages.pb.cc] Aborted
Comment 1 Jiří Moravec 2018-10-21 12:52:20 UTC
Created attachment 552090 [details]
build.log
Comment 2 Andreas Sturmlechner gentoo-dev 2018-10-21 14:25:18 UTC
Not reproducible here, looks like a protobuf problem?


>-- Found Threads: TRUE  
>terminate called after throwing an instance of 'std::system_error'
>  what():  Unknown error -1
>CMake Warning at /usr/share/cmake/Modules/FindProtobuf.cmake:429 (message):
>  Protobuf compiler version doesn't match library version 3.6.1
>Call Stack (most recent call first):
>  CMakeLists.txt:56 (find_package)
> 
> 
>-- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found version "3.6.1")


$ protoc --version
Comment 3 Arfrever Frehtes Taifersar Arahesis 2018-10-22 18:03:35 UTC
Please show 'emerge --info'.
Comment 4 Jiří Moravec 2018-10-23 15:50:27 UTC
(In reply to Andreas Sturmlechner from comment #2)
> Not reproducible here, looks like a protobuf problem?
> 
> 
> >-- Found Threads: TRUE  
> >terminate called after throwing an instance of 'std::system_error'
> >  what():  Unknown error -1
> >CMake Warning at /usr/share/cmake/Modules/FindProtobuf.cmake:429 (message):
> >  Protobuf compiler version doesn't match library version 3.6.1
> >Call Stack (most recent call first):
> >  CMakeLists.txt:56 (find_package)
> > 
> > 
> >-- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found version "3.6.1")
> 
> 
> $ protoc --version
$ protoc --version:
terminate called after throwing an instance of 'std::system_error'
what():  Unknown error -1
Neúspěšně ukončen (SIGABRT)
Comment 5 Jiří Moravec 2018-10-23 15:51:27 UTC
Created attachment 552512 [details]
emerge --info
Comment 6 Jiří Moravec 2018-10-23 15:58:21 UTC
Created attachment 552514 [details]
strace protoc
Comment 7 Jiří Moravec 2018-10-23 16:11:24 UTC
So it's look like problem in protobuf and not clementine...
Comment 8 Arfrever Frehtes Taifersar Arahesis 2018-10-23 18:45:00 UTC
Reporter of bug #669258 said that there was no problem after switching to BFD linker and rebuilding dev-libs/protobuf.
Could you test it?
(By switching ld or x86_64-pc-linux-gnu-ld symlinks and -fuse-ld=gold from *FLAGS)
Comment 9 Arfrever Frehtes Taifersar Arahesis 2018-10-23 18:47:29 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #8)
> (By switching ld or x86_64-pc-linux-gnu-ld symlinks and -fuse-ld=gold from
> *FLAGS)

(By switching ld or x86_64-pc-linux-gnu-ld symlinks and dropping -fuse-ld=gold from *FLAGS)
Comment 10 Jiří Moravec 2018-10-24 11:30:55 UTC
Yep, you're right. Adding CFLAGS="${CFLAGS} -fuse-ld=bfd" and LDFLAGS="${LDFLAGS} -Wl,-fuse-ld=bfd" into /etc/portage/package.env/ was enough. So for >dev-libs/protobuf-3.5.2 it is  necessary to insert tc-ld-disable-gold into src_configure() in both ebuilds.
Comment 11 Jiří Moravec 2018-10-24 11:34:12 UTC
So after fixing protobuf-3.6.0.1.ebuild and protobuf-3.6.1.ebuild, this bugreport can be changed into RESOLVED/FIXED.
Comment 12 Jiří Moravec 2018-10-24 11:39:41 UTC
Created attachment 552690 [details, diff]
protobuf-3.6.0.1 ebuild patch
Comment 13 Jiří Moravec 2018-10-24 11:40:11 UTC
Created attachment 552692 [details, diff]
protobuf-3.6.1 ebuild patch
Comment 14 Markus 2018-11-11 07:30:49 UTC
Same for net-p2p/bitcoin-qt.
Building dev-libs/protobuf with ld.gold, will make net-p2p/bitcoin-qt fail.
Rebuilding dev-libs/protobuf with ld.bfd and net-p2p/bitcoin-qt builds fine.
Comment 15 Arfrever Frehtes Taifersar Arahesis 2018-12-09 01:37:21 UTC
I have rebuilt dev-libs/protobuf (3.6.1, 3.6.1.1, 3.6.1.2) with -fuse-ld=gold flag and I CANNOT reproduce this bug.


Please check if building with GCC 8.* (and GOLD) makes any difference.
Comment 16 Arfrever Frehtes Taifersar Arahesis 2018-12-09 01:40:29 UTC
*** Bug 669258 has been marked as a duplicate of this bug. ***
Comment 17 Jiří Moravec 2018-12-13 16:50:59 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #15)
> I have rebuilt dev-libs/protobuf (3.6.1, 3.6.1.1, 3.6.1.2) with
> -fuse-ld=gold flag and I CANNOT reproduce this bug.
> 
> 
> Please check if building with GCC 8.* (and GOLD) makes any difference.

I just emerged latest dev-libs/protobuf-3.6.1.3::gentoo and then tried to compile clementine. Same error:

terminate called after throwing an instance of 'std::system_error'
what():  Unknown error -1

And emerging net-p2p/bitcoin-qt spit out same thing...

So on my system with gcc-8.2/binutils-2.31.1(ld.gold default), it's still necessary to go back to ld.bfd when building even latest protobuf-3.6.1.3.

So I still need workaround proposed in #c12/#c13. :-(
Comment 18 Arfrever Frehtes Taifersar Arahesis 2018-12-13 23:02:48 UTC
Please check if it matters which linker was used for building sys-devel/gcc (which provides libstdc++.so):
1. Rebuild sys-devel/gcc with BFD linker
2. Rebuild dev-libs/protobuf with GOLD linker
3. Check 'protoc --version'
Comment 19 Jiří Moravec 2018-12-14 19:41:29 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #18)
> Please check if it matters which linker was used for building sys-devel/gcc
> (which provides libstdc++.so):
> 1. Rebuild sys-devel/gcc with BFD linker
> 2. Rebuild dev-libs/protobuf with GOLD linker
> 3. Check 'protoc --version'


1) binutils-config --linker ld.bfd
2) disabling CFLAGS="${CFLAGS} -fuse-ld=gold" line in /etc/portage/make.conf
3) emerge -v1 =sys-devel/gcc-8.2.0-r5::gentoo
4) binutils-config --linker ld.gold
5) enabling CFLAGS="${CFLAGS} -fuse-ld=gold" line in /etc/portage/make.conf
6) emerge -v1 =dev-libs/protobuf-3.6.1.3::gentoo

still:

$ protoc --version
terminate called after throwing an instance of 'std::system_error'
what():  Unknown error -1
Comment 20 causality 2019-02-08 21:44:42 UTC
I discovered that building protobuf with LTO (gcc-8.2) also causes this exact same error when running "protoc --version".  Unlike most LTO problems, there were no errors during the building of protobuf.  However, protoc failed with this error and Clementine won't build.

So on my own system, it was not enough merely to ensure that dev-libs/protobuf was build with the BFD linker.  I had to also disable LTO.

Now Clementine builds successfully and running "protoc --version" produces the expected output.
Comment 21 Red 2019-03-22 04:26:53 UTC
I had this problem too, which caused trouble when trying to rebuild media-libs/opencv.

To fix this, I added "LD=ld.bfd" to /etc/portage/env/bfd.conf, with "sys-devel/gcc bfd.conf" to package.env.

Then I re-emerged gcc and the other packages mentioned in the instructions on https://wiki.gentoo.org/wiki/Upgrading_GCC.

I then added "dev-libs/protobuf bfd.conf" to my package.env, and attempted to re-emerge protobuf. This did not work. I had to run "binutils-config --linker ld.bfd" before re-emerging dev-libs/protobuf and then put it back to ld.gold when the emerge finished (I have to do it this way when compiling the kernel as well, see my comments at 678224).

After doing all this, media-libs/opencv emerges properly with ld.gold set as default linker.