Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588906 - www-client/firefox fails to build with >=sys-devel/binutils-2.26: ld: ../../xpcom/components/nsComponentManager.o: relocation R_X86_64_PC32 against protected symbol `end_kPStaticModules_NSModule' can not be used when making a shared object
Summary: www-client/firefox fails to build with >=sys-devel/binutils-2.26: ld: ../../x...
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: https://bugzilla.mozilla.org/show_bug...
Whiteboard:
Keywords:
: 589732 593244 (view as bug list)
Depends on:
Blocks: 594418
  Show dependency tree
 
Reported: 2016-07-15 17:46 UTC by rypervenche
Modified: 2016-09-22 15:39 UTC (History)
8 users (show)

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


Attachments
Last 2000 lines of build.log (firefox_build_2000.log,234.80 KB, text/plain)
2016-07-15 17:47 UTC, rypervenche
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rypervenche 2016-07-15 17:46:17 UTC
=www-client/firefox-47.0.1 fails to build when using =sys-devel/binutils-2.26.1, however it works correctly when using =sys-devel/binutils-2.25.1-r1.

Reproducible: Always

Steps to Reproduce:
1. binutils-config 2
 * Switching to x86_64-pc-linux-gnu-2.26.1 ...
2. . /etc/profile
3. emerge -v1 =www-client/firefox-47.0.1
Actual Results:  
Fails to compile at the very end, with messages in attached build.log

Expected Results:  
Firefox should compile correctly, as it does with =sys-devel/binutils-2.25.1-r1

# emerge -pv firefox

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] www-client/firefox-47.0.1::gentoo  USE="bindist dbus gmp-autoupdate gtk2 hwaccel jemalloc3 jit pulseaudio startup-notification -custom-cflags -custom-optimization -debug -hardened (-neon) (-pgo) (-selinux) (-system-cairo) -system-harfbuzz -system-icu -system-jpeg -system-libevent -system-libvpx -system-sqlite {-test} -wifi" L10N="ar cy de el eo fa fr is it ja nl ro ru tr zh-CN zh-TW -ach -af -an -as -ast -az -be -bg -bn-BD -bn-IN -br -bs -ca -cs -da -en-GB -en-ZA -es-AR -es-CL -es-ES -es-MX -et -eu -fi -fy -ga -gd -gl -gu -he -hi -hr -hsb -hu -hy -id -kk -km -kn -ko -lt -lv -mai -mk -ml -mr -ms -nb -nn -or -pa -pl -pt-BR -pt-PT -rm -si -sk -sl -son -sq -sr -sv -ta -te -th -uk -uz -vi -xh" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB


# emerge --info
Portage 2.3.0 (python 3.4.4-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.22-r4, 4.5.6-gentoo-lustre x86_64)
=================================================================
System uname: Linux-4.5.6-gentoo-lustre-x86_64-Intel-R-_Core-TM-_i5-5200U_CPU_@_2.20GHz-with-gentoo-2.2
KiB Mem:     8072896 total,   5626736 free
KiB Swap:    4194300 total,   4194132 free
Timestamp of repository gentoo: Fri, 15 Jul 2016 14:45:01 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
app-shells/bash:          4.3_p46::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo
dev-util/cmake:           3.6.0::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2-r1::gentoo
sys-apps/openrc:          0.21.2::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync11.us.gentoo.org/gentoo-portage
    priority: -1000

bliss-overlay
    location: /var/lib/layman/bliss-overlay
    sync-type: laymansync
    sync-uri: https://github.com/fearedbliss/bliss-overlay.git
    masters: gentoo
    priority: 50

mva
    location: /var/lib/layman/mva
    sync-type: laymansync
    sync-uri: git://github.com/msva/mva-overlay
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

tox-overlay
    location: /var/lib/layman/tox-overlay
    sync-type: laymansync
    sync-uri: git://github.com/Tox/gentoo-overlay-tox.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /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 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --quiet-build y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug st
rict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://lug.mtu.edu/gentoo/ ftp://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/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 --exclud
e=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cjk cli consolekit cracklib crypt cryptsetup cups cxx dbus dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdb
m geoip gif gimp git glamor gpm gtk gtk2 gtk3 iconv icu idn imagemagick ios iproute2 ipv6 jabber jpeg lcms ldap libass libmpeg2 libnotify lm_sensors lock m17n-lib mad maildir matroska mmx mmxext mng modules mp3 m
p4 mpeg multilib ncurses nls nptl ogg opengl openmp opus pam pango pcmcia pcre pdf png policykit ppds pulseaudio python qt3support qt4 readline scanner sdl seccomp session snmp socks5 speex spell srtp sse sse2 ss
h ssl startup-notification startup-notifications svg tcpd theora thunar tiff truetype udev unicode upower usb v4l video vim-syntax vnc vorbis vpx wxwidgets x264 xattr xcb xml xscreensaver xv xvid zlib" ABI_X86="6
4" 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_MO
DULES="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 autoin
dex 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 u
nique_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
" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navco
m oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev synaptics" KERNEL="linux" L10N="en fr zh-TW el ar ar-MA ro ru is 
fa de eo it ja nl zh-CN nb-NO hi-IN cy tr tr-TR" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en fr z
h_TW el ar ar_MA ro ru is fa de eo it ja nl zh_CN nb_NO hi_IN cy tr tr_TR" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" QEMU_USER_
TARGETS="x86_64" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal raw
nat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 rypervenche 2016-07-15 17:47:41 UTC
Created attachment 440820 [details]
Last 2000 lines of build.log

I can upload the full 6.5M file if needed, but it looks as though the relevant information is at the end.
Comment 2 Ivan Iraci 2016-07-28 10:49:35 UTC
Same problem here, same log so there's no need to attach mine.
Comment 3 Sven B. 2016-07-28 11:47:29 UTC
Works for my setup. You might try to use the system libraries instead of bundled, or perhaps gcc 5 as a potential temporary workaround for now. 

www-client/firefox-47.0.1::gentoo was built with the following:
USE="dbus gtk2 hwaccel jemalloc3 jit pulseaudio startup-notification system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-sqlite -bindist -custom-cflags -custom-optimization -debug -gmp-autoupdate -hardened (-neon) (-pgo) (-selinux) (-system-cairo) -test -wifi" ABI_X86="64" 

Portage 2.3.0 (python 3.5.2-final-0, default/linux/amd64/13.0/desktop, gcc-5.4.0, glibc-2.23-r2, 4.7.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.7.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-3720QM_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:    16392488 total,  11724228 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Thu, 28 Jul 2016 11:00:01 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p46::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.6.1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.2::gentoo
sys-apps/sandbox:         2.11-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Comment 4 Ivan Iraci 2016-07-28 21:45:59 UTC
(In reply to Sven B. from comment #3)

> Works for my setup. You might try to use the system libraries instead of
> bundled,

Even using system libraries, Firefox fails to build as well, with same log.

> or perhaps gcc 5 as a potential temporary workaround for now. 

It's unfeasible. It implies rebuilding @world from the ground up (more or less...). No, thanks...
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2016-07-28 22:08:29 UTC
(In reply to Sven B. from comment #5)
> This seems to be the same issue:
> https://bugzilla.opensuse.org/show_bug.cgi?id=984637
> 
> There is also a patch/hack mentioned:
> http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/www/firefox45/patches/patch-
> xpcom_components_Module.h?rev=1.1&content-type=text/x-cvsweb-markup
> 
> Might be worth a try.


That patch looks simple enough but before I apply it to the next release I would like to confirm with someone more knowledgeable what the impact is of dropping 'protected' to 'default', there.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2016-07-29 02:15:49 UTC
Something that might be worth noting here, is that firefox upstream doesn't actually officially support building with ld.bfd anymore ; they switched their official support to ld.gold around firefox-31.

Have you tried using ld.gold with binutils-2.26.1? does it work?

> binutils-config --linker ld.gold
Comment 8 klaus818 2016-07-29 06:31:20 UTC
No problem with the gold linker.
Comment 9 Ivan Iraci 2016-07-29 08:10:28 UTC
(In reply to klaus818 from comment #8)

> No problem with the gold linker.

Same here (firefox also builds much faster than with ld.bfd).

Anyway, remember to revert to ld.bfd immediately after building firefox!
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2016-07-29 14:48:36 UTC
(In reply to Ivan Iraci from comment #9)
> (In reply to klaus818 from comment #8)
> 
> > No problem with the gold linker.
> 
> Same here (firefox also builds much faster than with ld.bfd).
> 
> Anyway, remember to revert to ld.bfd immediately after building firefox!

Why?  ld.gold has been supported system-wide in gentoo for years.  Any packages that cannot link with gold already force ld.bfd (and if not there's a tracker bug somewhere for it).
Comment 11 Ivan Iraci 2016-07-29 14:55:42 UTC
(In reply to Ian Stakenvicius from comment #10)

> Why?  ld.gold has been supported system-wide in gentoo for years.  Any
> packages that cannot link with gold already force ld.bfd (and if not there's
> a tracker bug somewhere for it).

Because of this:
https://bugs.gentoo.org/show_bug.cgi?id=563364

Moreover, I knew that there were problems with compiling the kernel.

If both these problems have been superseded, I will be happy to switch to ld.gold as default linker.
Comment 12 Ian Stakenvicius (RETIRED) gentoo-dev 2016-07-29 15:02:11 UTC
(In reply to Ivan Iraci from comment #11)
> (In reply to Ian Stakenvicius from comment #10)
> 
> > Why?  ld.gold has been supported system-wide in gentoo for years.  Any
> > packages that cannot link with gold already force ld.bfd (and if not there's
> > a tracker bug somewhere for it).
> 
> Because of this:
> https://bugs.gentoo.org/show_bug.cgi?id=563364
> 
> Moreover, I knew that there were problems with compiling the kernel.
> 
> If both these problems have been superseded, I will be happy to switch to
> ld.gold as default linker.

That bug has been resolved in the ebuild, it's just left open until upstream's own code works properly with ld.gold.  I don't know what issues you have with kernels, compilation of all kernels since 3.14 have been working fine for me with ld.gold.

Back to the topic at hand, since ld.bfd is a valid option on gentoo I do still want to resolve this issue properly.  If it can't be resolved properly then I'll force ld.gold in the ebuilds.
Comment 13 Ivan Iraci 2016-07-29 15:16:30 UTC
(In reply to Ian Stakenvicius from comment #12)

> That bug has been resolved in the ebuild, it's just left open until
> upstream's own code works properly with ld.gold.  I don't know what issues
> you have with kernels, compilation of all kernels since 3.14 have been
> working fine for me with ld.gold.

Sorry for having spread misinformation, then.

I'm very happy of having been proved wrong.

Thanks.
Comment 14 Gerard van Vuuren 2016-07-31 17:53:33 UTC
Same problem here.
Used the same solution,downgrading binutils.
Gerard.
Comment 15 klaus818 2016-07-31 18:04:16 UTC
There is no need to downgrade the binutils. Switch to the gold linker.

And no, it is not possible to use the gold linker as the default linker. There are a lot of packages you can't build with the gold linker. But I was able to build all packages with the bfd linker with this exception.
Comment 16 Adrian Bassett 2016-08-01 08:36:38 UTC
(In reply to klaus818 from comment #15)
 
> And no, it is not possible to use the gold linker as the default linker.
> There are a lot of packages you can't build with the gold linker. But I was
> able to build all packages with the bfd linker with this exception.

That is something of a overstatement, at least in my case (~amd64):

With 3084 installed packages only 14 do not (re-)build with gold as the standard linker.  These exception are mainly taken care of with entries via the package.env mechanism; one, sys-fs/fuse, seems to require a manual 'binutils-config --linker ld.bfd'.
Comment 17 Ian Stakenvicius (RETIRED) gentoo-dev 2016-08-12 20:23:37 UTC
*** Bug 589732 has been marked as a duplicate of this bug. ***
Comment 18 josef.95 2016-09-20 23:28:21 UTC
I can confirm,

    INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o")

/usr/lib/gcc/i686-pc-linux-gnu/4.9.3/../../../../i686-pc-linux-gnu/bin/ld: ../../xpcom/components/nsComponentManager.o: relocation R_386_GOTOFF against protected data `start_kPStaticModules_NSModule' can not be used when making a shared object
/usr/lib/gcc/i686-pc-linux-gnu/4.9.3/../../../../i686-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[4]: *** [/var/tmp/portage/www-client/firefox-45.3.0/work/firefox-45.3.0esr/config/rules.mk:826: libxul.so] Error 1

with sys-devel/binutils-2.26.1
Switching to the gold linker works fine, without extra patches.

Thanks.
Comment 19 Ian Stakenvicius (RETIRED) gentoo-dev 2016-09-21 15:09:07 UTC
*** Bug 593244 has been marked as a duplicate of this bug. ***
Comment 20 Ian Stakenvicius (RETIRED) gentoo-dev 2016-09-21 20:45:37 UTC
I've committed the patch unconditionally to firefox-45.4.0 , firefox-49.0, and thunderbird-45.3.0-r2 ; will continue to carry it going forward unless we decide to force ld.gold or upstream no longer needs the patch.