Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664008 - Multiple packages fail to link with Gold due to -Wl,--fatal-warnings: "warning: discarding version information…, defined in unused shared library"
Summary: Multiple packages fail to link with Gold due to -Wl,--fatal-warnings: "warnin...
Status: RESOLVED DUPLICATE of bug 663512
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-18 22:21 UTC by Matt Whitlock
Modified: 2018-08-18 22:35 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2018-08-18 22:21:26 UTC
The following packages (and possibly many more)…

  kde-apps/kio-extras-18.08.0
  kde-apps/kleopatra-18.08.0
  kde-apps/kompare-18.08.0
  kde-apps/libkleo-18.08.0

…fail to link when Gold is the system default linker because CMake configures the linker flags with "-Wl,--fatal-warnings" and Gold emits a warning when discarding symbol versioning information from an unused shared library:

/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: discarding version information for __pthread_key_create@GLIBC_2.2.5, defined in unused shared library /lib64/libpthread.so.0 (linked with --as-needed)
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: treating warnings as errors
collect2: error: ld returned 1 exit status

A workaround is to append "-Wl,--no-fatal-warnings" to LDFLAGS on a per-package basis, but ideally CMake would not be specifying "-Wl,--fatal-warnings" in the first place, as that's a good option for developers but a bad option for users.


# emerge --info | fgrep -e cmake -e binutils
dev-util/cmake:           3.12.1::gentoo
sys-devel/binutils:       2.31.1::gentoo
Comment 1 Jonas Stein gentoo-dev 2018-08-18 22:34:40 UTC

*** This bug has been marked as a duplicate of bug 663512 ***
Comment 2 Matt Whitlock 2018-08-18 22:35:51 UTC
(In reply to Jonas Stein from comment #1)
> 
> *** This bug has been marked as a duplicate of bug 663512 ***

*sigh* I almost explicitly pointed out that this is NOT a duplicate of that bug, but I thought maybe it would be obvious enough. I guess not.

This is NOT a duplicate of Bug 663512, as that bug is about LTO, and this bug is about Gold.