Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 663512 - =kde-frameworks/khtml-5.49.0 with ld.gold and GCC8 fails with "ld: warning: discarding version information for __cxa_finalize@GLIBC_2.2.5, defined in unused shared library /lib64/libc.so.6 (linked with --as-needed)"
Summary: =kde-frameworks/khtml-5.49.0 with ld.gold and GCC8 fails with "ld: warning: d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 664008 (view as bug list)
Depends on:
Blocks: systemwide-gold
  Show dependency tree
 
Reported: 2018-08-13 14:14 UTC by Steffen Hau
Modified: 2019-05-16 08:38 UTC (History)
5 users (show)

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


Attachments
kde-frameworks/khtml-5.49.0 build.log (kde-frameworks_khtml-5.49.0-build.log.xz,8.05 KB, application/x-xz)
2018-08-13 14:14 UTC, Steffen Hau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Hau 2018-08-13 14:14:20 UTC
Created attachment 543252 [details]
kde-frameworks/khtml-5.49.0 build.log

See attached build.log.

Either disabling LTO makes the warning disappear or removing "-Wl,--fatal-warnings" solve the issue. I have no clue why ld (Gold, didn't test ld.bfd) reports this warning.



Portage 2.3.46 (python 3.6.6-final-0, default/linux/amd64/17.1/systemd, gcc-8.2.0, glibc-2.27-r6, 4.17.14-HAUIHAU x86_64)
=================================================================
System uname: Linux-4.17.14-HAUIHAU-x86_64-Intel-R-_Core-TM-_i5-6200U_CPU_@_2.30GHz-with-gentoo-2.6
KiB Mem:     8099960 total,   3381340 free
KiB Swap:    8388604 total,   7422204 free
Timestamp of repository gentoo: Mon, 13 Aug 2018 08:30:01 +0000
Head commit of repository gentoo: 51b60979365ef5f284e629f851861c7cedb3a535
sh bash 4.4_p23
ld GNU gold (Gentoo 2.31.1 p1 2.31.1) 1.16
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo
dev-util/cmake:           3.12.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1::gentoo
sys-devel/gcc:            8.2.0-r2::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r3::gentoo
sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

hauihau
    location: /usr/local/portage/hauihau
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe -flto=5 -fuse-linker-plugin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -pipe -flto=5 -fuse-linker-plugin -fno-delete-null-pointer-checks -flifetime-dse=1"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going=y --quiet-build=y --quiet-fail=y --with-bdeps=y --changed-deps-report=n"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync metadata-transfer multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-march=native -O3 -pipe -flto=5 -fuse-linker-plugin -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--gc-sections -Wl,--icf=safe"
LINGUAS="de"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/home/gentoo/tmp/"
USE="X a52 aac aalib acl alsa amd64 avx avx2 bash-completion berkdb bluetooth bluray branding bzip2 cairo caps cdda cddb cdparanoia cdr cli cracklib crypt cups curl cxx dbus dga dri dts dv dvd egl encode exif ffmpeg flac fontconfig fortran ftp gd gdbm gif gmp gstreamer iconv icu imagemagick imlib ipv6 jpeg jpeg2k kde kerberos lame libcaca libnotify libsamplerate libtirpc lzma lzo mad matroska mmx mmxext mng modules mp3 mpeg mtp multilib musepack ncurses networkmanager nls nptl nsplugin ogg openal opengl openmp pam pcre pdf png policykit pulseaudio qt5 quicktime readline seccomp sndfile spell sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 svg syslog systemd tcpd theora threads tiff truetype udev unicode usb v4l vaapi vcd vim-syntax vorbis wavpack wayland webkit x264 xattr xcb xcomposite xinerama xml xmp xorg xosd xpm xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Adrian Bassett 2018-08-13 18:39:38 UTC
(In reply to Steffen Hau from comment #0)
> Created attachment 543252 [details]
> kde-frameworks/khtml-5.49.0 build.log
> 
> See attached build.log.
> 
> Either disabling LTO makes the warning disappear or removing
> "-Wl,--fatal-warnings" solve the issue. I have no clue why ld (Gold, didn't
> test ld.bfd) reports this warning.

I had a similar experience with kwallet (don't have much kde on my system) but, following your suggestion, running

LDFLAGS="${LDFLAGS} -Wl,--no-fatal-warnings" emerge -1v --nodeps kwallet

meant that the build succeeded.

This was true for the then currently-installed 5.48.0 which wouldn't rebuild (both gcc and clang were tried as also ld.bdf and ld.gold).
Comment 2 Jonas Stein gentoo-dev 2018-08-18 22:34:40 UTC
*** Bug 664008 has been marked as a duplicate of this bug. ***
Comment 3 Matt Whitlock 2018-08-18 22:39:20 UTC
These packages are also affected:

  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

I would note that I am *not* using explicitly enabling LTO. These packages fail to link with the rather mundane flags:

  CFLAGS="-march=native -O3 -ggdb -pipe"
  CXXFLAGS="${CFLAGS}"
  LDFLAGS="-Wl,-O2 -Wl,--as-needed"

/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
Comment 4 Michael Palimaka (kensington) gentoo-dev 2018-08-19 13:53:24 UTC
CCing toolchain to get insight into this linker warning.

In the meantime, we could consider removing -Wl,--fatal-warnings from KDECompilerSettings.cmake in ECM to avoid triggering a build failure when this warning is encountered.
Comment 5 Larry the Git Cow gentoo-dev 2018-08-19 14:00:42 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=d02ce6c1b55141859d389596b079200ad6e9e400

commit d02ce6c1b55141859d389596b079200ad6e9e400
Author:     Michael Palimaka <kensington@gentoo.org>
AuthorDate: 2018-08-19 14:00:12 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-08-19 14:00:25 +0000

    kde-frameworks/extra-cmake-modules: avoid build failure with GCC8 and ld.gold
    
    Bug: https://bugs.gentoo.org/663512
    Package-Manager: Portage-2.3.44, Repoman-2.3.10

 .../extra-cmake-modules-9999.ebuild                   |  2 ++
 ...extra-cmake-modules-5.49.0-no-fatal-warnings.patch | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2018-08-19 14:08:06 UTC
The bug has been referenced in the following commit(s):

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

commit a49d8c2a95711b9f166c59e3be0df26b75b88290
Author:     Michael Palimaka <kensington@gentoo.org>
AuthorDate: 2018-08-19 14:03:30 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-08-19 14:07:54 +0000

    kde-frameworks/extra-cmake-modules: avoid build failure with GCC8 and ld.gold
    
    Bug: https://bugs.gentoo.org/663512
    Package-Manager: Portage-2.3.44, Repoman-2.3.10

 ....0.ebuild => extra-cmake-modules-5.49.0-r1.ebuild} |  2 ++
 ...extra-cmake-modules-5.49.0-no-fatal-warnings.patch | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)
Comment 7 Matt Whitlock 2018-08-20 23:06:36 UTC
The patched kde-frameworks/extra-cmake-modules eliminates the link failures in the four packages I listed in Comment #3. Thanks.

Note that the warnings about discarded version information are still present, as would be expected, but they no longer force the linker to fail.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-02 12:34:13 UTC
(In reply to Matt Whitlock from comment #3)
> These packages are also affected:
> 
>   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
> 
> I would note that I am *not* using explicitly enabling LTO. These packages
> fail to link with the rather mundane flags:
> 
>   CFLAGS="-march=native -O3 -ggdb -pipe"
>   CXXFLAGS="${CFLAGS}"
>   LDFLAGS="-Wl,-O2 -Wl,--as-needed"
> 
> /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

Next binutils (future 2.32 release) will not warn about it by default (guarded by --warn-drop-version):
    https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=3a12c78d1491c4877928e7294c8cdbe8171dfeed
Comment 9 Mike Gilbert gentoo-dev 2019-02-17 18:12:46 UTC
The build failure has been worked around, so I am unblocking gcc-8.