Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494364 - www-client/firefox-{26.0,27.0,28.0} - configure fails with LDFLAGS="-Wl,--add-needed"
Summary: www-client/firefox-{26.0,27.0,28.0} - configure fails with LDFLAGS="-Wl,--add...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
: 506196 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-15 16:38 UTC by Maciej Piechotka
Modified: 2014-04-02 18:55 UTC (History)
1 user (show)

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


Attachments
www-client:firefox-26.0:20131215-140234.log.gz (www-client:firefox-26.0:20131215-140234.log.gz,15.33 KB, application/gzip)
2013-12-15 16:38 UTC, Maciej Piechotka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Piechotka 2013-12-15 16:38:03 UTC
Created attachment 365414 [details]
www-client:firefox-26.0:20131215-140234.log.gz

Portage 2.2.7 (default/linux/amd64/13.0/desktop/gnome, gcc-4.8.2, glibc-2.17, 3.12.3-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.12.3-gentoo-x86_64-Intel-R-_Core-TM-_i7-3820QM_CPU_@_2.70GHz-with-gentoo-2.2
KiB Mem:    16069252 total,   8707896 free
KiB Swap:   16777212 total,  16777076 free
Timestamp of tree: Sun, 15 Dec 2013 12:45:01 +0000
ld GNU ld (Linux/GNU Binutils) 2.23.52.0.2.20130423
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.3.3
dev-util/cmake:           2.8.12.1-r2
dev-util/pkgconfig:       0.28
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.12.6, 1.14
sys-devel/binutils:       2.23.52.0.2
sys-devel/gcc:            4.7.3-r1, 4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.12 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo crossdev gentoo-haskell vala steam-overlay bumblebee gnome x11 gnome-next local
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -ggdb -Wa,--compress-debug-sections"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.1/conf /var/lib/hsqldb"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe -ggdb -Wa,--compress-debug-sections"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="-j8 --load-average=7"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs clean-logs compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms split-elog splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://ftp.heanet.ie/pub/gentoo/ ftp://ftp.heanet.ie/pub/gentoo/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--add-needed -Wl,--hash-style=both -Wl,--sort-common -Wl,--no-keep-memory"
MAKEOPTS="-j4 -l7"
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="/usr/local/portage-crossdev /var/lib/layman/haskell /var/lib/layman/vala /var/lib/layman/steam /var/lib/layman/bumblebee /var/lib/layman/gnome /var/lib/layman/x11 /var/lib/layman/heather-gnome /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avx berkdb bluetooth branding bzip2 bzr c++0x cairo caps cdda cdr cli clutter colord cracklib crypt cryptsetup cups cxx dbus dconf debugger device-mapper doc dri dts dvd dvdr eds emacs emboss encode evo exif fam ffmpeg firefox flac flash fontconfig fortran fprint fuse g3dvl gbm gdbm gdm gif git gmp gnome gnome-keyring gnome-online-accounts gnuplot gnutls google gpm grilo gsettings gstreamer gtk gtk3 gtkstyle gui hoogle hscolour iconv inotify introspection iproute2 ipsec ipv6 ipython irc ithreads jabber jemalloc jit jpeg kerberos laptop latex lcms ldap libkms libnotify libproxy libsecret llvm lvm lzma mad map mercurial mmx mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses networking networkmanager nls nptl nsplugin ogg opencl opengl openmp oss pam pango parted pch pcre pdf perl pkcs11 plotutils png policykit ppds profiler pulseaudio python python3 qemu qt4 readline realtime rss samba sdl session sna socialweb spell spice sqlite sse sse2 sse4_1 sse4_2 ssl ssse3 startup-notification steamruntime subversion svg symlink systemd tcpd telepathy theora threads tiff tracker truetype udev udisks unicode upnp upower usb v4l vaapi vala vdpau virt-network virtfs vorbis vpx webkit wxwidgets x264 xattr xcb xcomposite xinerama xml xrandr xv xvid zeitgeist zlib zsh-completion" ABI_X86="32 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" DRACUT_MODULES="caps crypt lvm" 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" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="evdev synaptics mouse mutouch" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en pl en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_3" PYTHON_TARGETS="python3_3 pypy2_0" QEMU_SOFTMMU_TARGETS="arm x86_64 i386" QEMU_USER_TARGETS="arm x86_64 i386" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel nvidia" 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"
USE_PYTHON="3.3 2.7-pypy-2.0"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

www-client/firefox-25.0.1 was built with the following:
USE="alsa dbus gstreamer jit libnotify minimal (multilib) pulseaudio startup-notification -bindist -custom-cflags -custom-optimization -debug (-pgo) (-selinux) -system-cairo -system-icu -system-jpeg -system-sqlite -wifi" ABI_X86="64" LINGUAS="en_GB pl -af -ak -ar -as -ast -be -bg -bn_BD -bn_IN -br -bs -ca -cs -csb -cy -da -de -el -en_ZA -eo -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy_NL -ga_IE -gd -gl -gu_IN -he -hi_IN -hr -hu -hy_AM -id -is -it -ja -kk -km -kn -ko -ku -lg -lt -lv -mai -mk -ml -mr -nb_NO -nl -nn_NO -nso -or -pa_IN -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW -zu"
CFLAGS="-march=native -pipe -ggdb -Wa,--compress-debug-sections -mno-avx"
CXXFLAGS="-march=native -pipe -ggdb -Wa,--compress-debug-sections -mno-avx"
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-16 12:14:27 UTC
Please post your `emerge -vpq media-libs/libpng' output in a comment.
Comment 2 Maciej Piechotka 2013-12-16 19:50:46 UTC
(In reply to Jeroen Roovers from comment #1)
> Please post your `emerge -vpq media-libs/libpng' output in a comment.

[ebuild   R   ] media-libs/libpng-1.6.7  USE="apng static-libs (-neon)" ABI_X86="32 (64) (-x32)"
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2014-03-27 16:37:09 UTC
So the ./configure failure is easy enough to reproduce:
#1 - set LDFLAGS= in make.conf to include '-Wl,--add-needed'
#2 - try and emerge firefox-28.

The reason for the failure is simple:  ld.gold does not support --add-needed (or --copy-dt-needed-entries , which is the proper option name now)...  

By default, it seems, firefox-26 and above have --enable-gold set.  This can be undone by setting "mozconfig_annotate '' --disable-gold" within src_configure in the ebuild:

--- firefox-28.0.ebuild 22 Mar 2014 10:57:55 -0000      1.3
+++ firefox-28.0.ebuild 27 Mar 2014 16:32:26 -0000
@@ -217,6 +217,7 @@
        mozconfig_annotate '' --disable-mailnews
        mozconfig_annotate '' --with-system-png
        mozconfig_annotate '' --enable-system-ffi
+       mozconfig_annotate '' --disable-gold
 
        # Other ff-specific settings
        mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}


HOWEVER, at this time, i'm not sure if gentoo should be doing this by default -- for instance, it may make more sense to strip -Wl,--add-needed from LDFLAGS.  Also, this is not a valid case for a use flag so we won't be making it optional.  MAYBE we could set this in the ebuild to be conditional on the existence of the flag in LDFLAGS, unsure...
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2014-03-27 18:14:45 UTC
To the user:

First of all, do you realize -Wl,--add-needed is deprecated flag in favour of -Wl,--copy-dt-needed-entries?
And do you realize -Wl,--add-needed or -Wl,--copy-dt-needed-entries in fact *adds* overlinking, and is counter productive?
You propably want to remove it from your flags, to get reduce overhead, remove it altogether since -Wl,--no-copy-dt-needed-entries has been the default for a while now.

To the maintainers:

There is m4/attributes.m4 in systemd's tarball that allows you to do this from configure.ac:

CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [-Wl,-fuse-ld=gold])
AC_SUBST([OUR_LDFLAGS], "$with_ldflags")

And Makefile.am

AM_LDFLAGS = $(OUR_LDFLAGS)

As in, there is a proper way to check that binutils is new enough and has -Wl,-fuse-ld=gold, and that it works, as opposed to blindly calling ld.gold
I expect you manage a patch out from this information for upstream ;-)
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-03-27 18:17:21 UTC
(In reply to Samuli Suominen from comment #4)
> To the maintainers:
> 
> There is m4/attributes.m4 in systemd's tarball that allows you to do this
> from configure.ac:
> 
> CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [-Wl,-fuse-ld=gold])
> AC_SUBST([OUR_LDFLAGS], "$with_ldflags")
> 
> And Makefile.am
> 
> AM_LDFLAGS = $(OUR_LDFLAGS)
> 
> As in, there is a proper way to check that binutils is new enough and has
> -Wl,-fuse-ld=gold, and that it works, as opposed to blindly calling ld.gold
> I expect you manage a patch out from this information for upstream ;-)

So by adding the check I described above, it will use the current environment LDFLAGS, including the users -Wl,--add-needed mentioned in this bug, and try it within combination of the -Wl,-fuse-ld=gold, so the check would then fail if user has incompatible flags for gold, and then not use it, and fallback to bfd
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2014-03-27 18:24:09 UTC
Thanks ssuominen!

Reading through the build system, I think I've changed my mind..  it looks like the MOZ_FORCE_GOLD option (which is what --enable-gold sets) is meant to be there for "local builds", which I assume are builds done by mozilla developers, or possibly by mozilla development machines (tinderboxes).  

Setting --disable-gold has no effect on the buildsystem outside of removing the workaround that guarantees linking with ld.gold; and it would seem to make more sense for the whole build system to use ${LD} than for a hack to override it.  A search on mozilla's bugzilla doesn't show any particular need for ld.gold, and if the rest of a user's system is using ld.bfd, I see no reason why firefox shouldn't.

With mozilla lead's blessings, I would like to set this in the ebuilds.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2014-03-27 18:41:53 UTC
The upstream bug discussing the switch to ld.gold by default:

https://bugzilla.mozilla.org/show_bug.cgi?id=633269

speed improvements during build seem to be the primary reason, better LTO support being another.  

Is it safe to expect anyone experimenting with LTO will also be experimenting with ld.gold?  Or alternatively, is it safe to not expect that we need to support them blindly?  :)
Comment 8 Maciej Piechotka 2014-03-27 19:32:10 UTC
(In reply to Samuli Suominen from comment #4)
> To the user:
> 
> First of all, do you realize -Wl,--add-needed is deprecated flag in favour
> of -Wl,--copy-dt-needed-entries?
> And do you realize -Wl,--add-needed or -Wl,--copy-dt-needed-entries in fact
> *adds* overlinking, and is counter productive?
> You propably want to remove it from your flags, to get reduce overhead,
> remove it altogether since -Wl,--no-copy-dt-needed-entries has been the
> default for a while now.
> 

Re: Deprecation - I didn't know it
Re: overlinking - on the other hand it saved me from problems with missing dependencies (well - at least back in 2006 or so it was a problem) so depends on what you mean "counter-productive". It's good that it is no longer needed but IIRC it was quite important 'anti-frustration' feature back then.
Comment 9 Ian Stakenvicius (RETIRED) gentoo-dev 2014-03-27 19:41:42 UTC
(In reply to Maciej Piechotka from comment #8)

> Re: overlinking - on the other hand it saved me from problems with missing
> dependencies (well - at least back in 2006 or so it was a problem) so
> depends on what you mean "counter-productive". It's good that it is no
> longer needed but IIRC it was quite important 'anti-frustration' feature
> back then.


~2006 sounds like about when -Wl,--as-needed was just being rolled out, and some packages had bugs and needed their library linking adjusted.  At any rate, the vast majority of the gentoo user base is using -Wl,--as-needed without -Wl,--add-needed and does not have issues, since this has been default for at least a few years.
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2014-04-02 13:58:03 UTC
*** Bug 506196 has been marked as a duplicate of this bug. ***
Comment 11 Ian Stakenvicius (RETIRED) gentoo-dev 2014-04-02 14:13:54 UTC
@@ -4,0 +5,3 @@
+  02 Apr 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org> firefox-28.0.ebuild:
+  disable the forcing of ld.gold in the mozilla build system, bug 494364
+
Comment 12 Ian Stakenvicius (RETIRED) gentoo-dev 2014-04-02 18:55:36 UTC
Fixed www-client/seamonkey too, as it had the same issue.