Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 437262 - app-text/fbreader-0.99.1 produces non-working binary with ld.gold
Summary: app-text/fbreader-0.99.1 produces non-working binary with ld.gold
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrey Grozin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gold-tracker
  Show dependency tree
 
Reported: 2012-10-05 08:05 UTC by Andreas K. Hüttel
Modified: 2019-05-04 13:02 UTC (History)
6 users (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 Andreas K. Hüttel gentoo-dev 2012-10-05 08:05:46 UTC
Emerging fbreader with gold works fine, but the resulting binary does not run. 

(It complains about a missing symbol "initLibrary" in one of the so's installed by fbreader.)

Re-setting the linker to ld.bfd and re-emerging fbreader fixes the problem.

More info later...
Comment 1 Nikoli 2012-10-17 09:51:13 UTC
Please try fbreader-0.99.2
Comment 2 Michael Palimaka (kensington) gentoo-dev 2012-10-17 09:51:43 UTC
(In reply to comment #1)
> Please try fbreader-0.99.2

No change.
Comment 3 Alexey Shvetsov gentoo-dev 2013-02-16 17:00:35 UTC
I added issue upstream 
https://github.com/geometer/FBReader/issues/233
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2013-05-25 08:17:10 UTC
fbreader-0.99.4-r1 works fine here with binutils-2.23.2.


Portage 2.2.0_alpha177 (default/linux/amd64/13.0/developer, gcc-4.8.0, glibc-2.17, 3.9.2-gentoo x86_64)
=================================================================
System uname: Linux-3.9.2-gentoo-x86_64-Intel-R-_Core-TM-_i7-3920XM_CPU_@_2.90GHz-with-gentoo-2.2
KiB Mem:    32597924 total,   6039552 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of tree: Sat, 25 May 2013 04:30:02 +0000
ld GNU ld (GNU Binutils) 2.23.2
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.8-r1, 2.7.4, 3.1.5-r1, 3.2.4, 3.3.2
dev-util/ccache:          3.1.9::local
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.13.2
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.5.4, 4.6.4, 4.7.3::local, 4.7.4_pre9999::toolchain, 4.8.0, 4.8.1_pre9999::toolchain
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo local gcc-porting toolchain dirtyepic
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -g -frecord-gcc-switches -fuse-ld=gold -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -g -frecord-gcc-switches -fuse-ld=gold -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
FCFLAGS="-O2 -march=native -g -frecord-gcc-switches -fuse-ld=gold -pipe"
FEATURES="assume-digests binpkg-logs ccache clean-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict test test-fail-continue unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=native -g -frecord-gcc-switches -fuse-ld=gold -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j10 V=1"
Comment 5 Nuno Silva 2014-09-21 17:38:09 UTC
fbreader-0.99.4-r2 does not work here, binutils-2.23.2 (Ryan, your emerge --info shows GNU ld, not GNU gold)

Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.19-r1, 3.12.13-gentoo-ir1-20140511 x86_64)
=================================================================
System uname: Linux-3.12.13-gentoo-ir1-20140511-x86_64-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-2.2
KiB Mem:     4047244 total,    404924 free
KiB Swap:    3903788 total,   3878012 free
Timestamp of tree: Thu, 18 Sep 2014 08:30:01 +0000
ld GNU gold (GNU Binutils 2.23.2) 1.11
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.7, 3.3.5-r1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.6.3, 4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo finnish sunrise steam-overlay lisp poly-c emacs x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/finnish /var/lib/layman/sunrise /var/lib/layman/steam /var/lib/layman/lisp /var/lib/layman/poly-c /var/lib/layman/emacs /usr/local/portage"
USE="X aac aalib acl alsa amd64 berkdb bzip2 cli cracklib crypt cxx djvu dri dvi emacs flac fortran gdbm gif iconv ipv6 jpeg jpeg2k lame latex libcaca mmx modules mp3 mp4 mpeg multilib ncurses nls nptl ogg openmp pam pcre png pnm qt3support readline session sse sse2 ssl steamruntime tcpd theora tiff unicode vorbis x264 zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DVB_CARDS="tda10045 tda10046" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse aiptek" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en pt fi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="radeon vesa nouveau" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-08-18 17:21:58 UTC
I can repro with 0.99.4-r2. CC-ing the current maintainer. Please at least try to work it around with -fuse-ld=bfd.
Comment 7 Andrey Grozin gentoo-dev 2016-08-31 13:13:04 UTC
commit 31ace4f36832baf4083cad886a37b3bae0a0bfcf
Author: Andrey Grozin <grozin@gentoo.org>
Date:   Wed Aug 31 20:06:44 2016 +0700

    app-text/fbreader: link with bfd
    
    Bug: 437262
    
    Package-Manager: portage-2.3.0

Please check that this workaround with -fuse-ld=bfd actually works on a system where gold is installed. I don't use gold (I prefer my system to just work, in particular, I use fbreader every day). At least, on my computer this patch does not break fbreader.
Comment 8 Dennis Schridde 2019-05-04 13:02:15 UTC
app-text/fbreader-0.99.4-r5 should contain a fix:
--- 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'
 

However, a nicer solution might be to use tc-ld-disable-gold from toolchain-funcs.eclass, which appears to be 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.