Created attachment 573470 [details] emerge --info dev-libs/protobuf Using -fuse-ld=bfd solves the issue.
Created attachment 573472 [details] build.log
(In reply to Tomas Jelinek from comment #0) > Created attachment 573470 [details] > emerge --info dev-libs/protobuf > > Using -fuse-ld=bfd solves the issue. dev-lang/ghc-8.6.4 appears to also have trouble with ld.gold and solves that in this way: case ${CTARGET} in arm*) # ld.bfd-2.28 does not work for ghc. Force ld.gold # instead. This should be removed once gentoo gets # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177 econf_args+=(LD=${CTARGET}-ld.gold) ;; sparc*) # ld.gold-2.28 does not work for ghc. Force ld.bfd # instead. This should be removed once gentoo gets # a fix for missing --no-relax support bug: # https://sourceware.org/ml/binutils/2017-07/msg00183.html econf_args+=(LD=${CTARGET}-ld.bfd) ;; *) econf_args+=(LD=${CTARGET}-ld) esac app-text/fbreader-0.99.4-r5 also contains a patch with custom logic to force usage of ld.bfd: --- fbreader-0.99.4.orig/fbreader/Makefile 2012-11-30 19:41:25.000000000 +0700 +++ fbreader-0.99.4/fbreader/Makefile 2018-01-11 22:18:18.000208200 +0700 @@ -23,5 +23,5 @@ done; @echo -n 'Linking $(TARGET) ...' - @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o` $(TEXT_LIBS) $(CORE_LIBS) $(ZLUI_LIB) -lsqlite3 + @$(LD) -fuse-ld=bfd $(LDFLAGS) -o $(TARGET) `find src -name *.o` $(TEXT_LIBS) $(CORE_LIBS) $(ZLUI_LIB) -lsqlite3 @echo ' OK' toolchain-funcs.eclass on the other hand ships tc-ld-disable-gold which seems to contain a generic solution: # @FUNCTION: tc-ld-disable-gold # @USAGE: [toolchain prefix] # @DESCRIPTION: # If the gold linker is currently selected, configure the compilation # settings so that we use the older bfd linker instead.
(In reply to Dennis Schridde from comment #2) > app-text/fbreader-0.99.4-r5 also contains a patch with custom logic to force > usage of ld.bfd: > [...] See-Also: https://bugs.gentoo.org/show_bug.cgi?id=437262
We are planning investigation on proper fix (either in protobuf or gold itself), instead of applying some workarounds like tc-ld-disable-gold().
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #4) > We are planning investigation on proper fix (either in protobuf or gold > itself), instead of applying some workarounds like tc-ld-disable-gold(). Until that has been done: Could we please get a workaround? It has been almost two weeks since this issue emerged.
> Until that has been done: Could we please get a workaround? It has been > almost two weeks since this issue emerged. Haha! As I know Michał Górny, now you can expect =dev-libs/protobuf-3.7.1 in package.mask ;-)
https://sourceware.org/bugzilla/show_bug.cgi?id=24527
In libraries build with linker BFD: $ nm libprotobuf.so.18.0.1 | grep scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto 000000000033ad60 D scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto $ nm libprotoc.so.18.0.1 | grep scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto U scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto $ readelf -dW libprotoc.so.18.0.1 | grep libprotobuf.so.18 0x0000000000000001 (NEEDED) Shared library: [libprotobuf.so.18] In libraries build with linker GOLD: $ nm libprotobuf.so.18.0.1 | grep scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto 0000000000349340 d scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto $ nm libprotoc.so.18.0.1 | grep scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto U scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto $ readelf -dW libprotoc.so.18.0.1 | grep libprotobuf.so.18 0x0000000000000001 (NEEDED) Shared library: [libprotobuf.so.18]
I suspect that this bug in linker GOLD might remain open for longer time, so I will force linker BFD in ebuilds of dev-libs/protobuf in situation when detected linker is linker GOLD (but not any other linker, like linker LLD). (Problem with 'extern "C++"' is absent in linker LLD. Linker LLD does not support 'extern "Java"'. dev-libs/protobuf-3.7.1 with compiler Clang 8.0.0 and linker LLD 8.0.0 builds correctly and passes all tests. In dev-libs/protobuf-3.7.1, there are no differences between list of defined global symbols in libraries built with compiler Clang 8.0.0 + linker BFD and list of defined global symbols in libraries built with compiler Clang 8.0.0 + linker LLD 8.0.0.)
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #9) > I suspect that this bug in linker GOLD might remain open for longer time, so > I will force linker BFD in ebuilds of dev-libs/protobuf in situation when > detected linker is linker GOLD (but not any other linker, like linker LLD). Has this happened yet? For me dev-libs/protobuf-3.7.1 still fails to build.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4be8cdbce708604f34fd8d9018198027e353a011 commit 4be8cdbce708604f34fd8d9018198027e353a011 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> AuthorDate: 2019-05-17 15:14:37 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2019-05-17 19:33:25 +0000 dev-libs/protobuf: Force linker BFD when linker GOLD is detected. Fixes: https://bugs.gentoo.org/683892 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Mike Gilbert <floppym@gentoo.org> dev-libs/protobuf/protobuf-3.7.1.ebuild | 6 ++++++ 1 file changed, 6 insertions(+)