Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646150 - www-client/firefox-58.0.1 - src_compile(): error: linking with `/var/tmp/portage/www-client/firefox-58.0.1/work/firefox-58.0.1/build/cargo-linker` failed: exit code: 1
Summary: www-client/firefox-58.0.1 - src_compile(): error: linking with `/var/tmp/port...
Status: RESOLVED INVALID
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:
Depends on:
Blocks:
 
Reported: 2018-01-30 19:12 UTC by Morgan Wesström
Modified: 2019-03-31 20:06 UTC (History)
5 users (show)

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


Attachments
build.log (build.log,839.95 KB, text/plain)
2018-01-30 19:12 UTC, Morgan Wesström
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Morgan Wesström 2018-01-30 19:12:59 UTC
Created attachment 517162 [details]
build.log

Emerging www-client/firefox-58.0.1 fails with the following message in a 32-bit chroot:
error: linking with `/var/tmp/portage/www-client/firefox-58.0.1/work/firefox-58.0.1/build/cargo-linker` failed: exit code: 1
I have also tested emerging it without all the system-* USE variables but the error message is the same. Attaching the requested information and build log.
Comment 1 Morgan Wesström 2018-01-30 19:14:29 UTC
emerge --info '=www-client/firefox-58.0.1::gentoo

Portage 2.3.19 (python 3.5.4-final-0, default/linux/x86/17.0, gcc-6.4.0, glibc-2.25-r9, 4.14.14-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.14-gentoo-i686-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.4.1
KiB Mem:    18485068 total,   1217420 free
KiB Swap:    8388540 total,   8388540 free
Timestamp of repository gentoo: Tue, 30 Jan 2018 09:45:01 +0000
Head commit of repository gentoo: d63c01c9c058eab90ef4c63449f604bdfb03ff35
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://localhost/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="i686-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="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=y --keep-going"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp.ds.karen.hj.se/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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="/var/tmp"
USE="X acl acpi alsa berkdb bzip2 cli crypt cxx dri fortran gdbm gif iconv icu idn ipv6 jpeg mmx modules ncurses nls nptl opengl openmp pam pcre png readline seccomp ssl tcpd threads tiff unicode vaapi vdpau x86 xattr zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext 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" INPUT_DEVICES="evdev" KERNEL="linux" 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" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Morgan Wesström 2018-01-30 19:15:07 UTC
emerge -pqv '=www-client/firefox-58.0.1::gentoo'

[ebuild     U ] www-client/firefox-58.0.1 [57.0.4] USE="gmp-autoupdate screenshot system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-sqlite -bindist -custom-cflags -custom-optimization -dbus -debug -eme-free -hardened -hwaccel -jack (-neon) -pulseaudio (-selinux) -startup-notification {-test} -wifi (-nsplugin%) (-pgo%)" L10N="-ach -af -an -ar -as -ast -az -bg -bn-BD -bn-IN -br -bs -ca -cak -cs -cy -da -de -dsb -el -en-GB -en-ZA -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mai -mk -ml -mr -ms -nb -nl -nn -or -pa -pl -pt-BR -pt-PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv -ta -te -th -tr -uk -uz -vi -xh -zh-CN -zh-TW"
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2018-02-01 00:55:34 UTC
I'm spinning up a 32bit chroot as i type, to see if I can reproduce this.
Comment 4 Morgan Wesström 2018-02-01 01:04:09 UTC
It's a very minimal installation I use to run a game through wine so there shouldn't be much there to interfere.

$ cat /var/lib/portage/world
app-admin/gamin
app-emulation/wine-staging:2.21
app-portage/cpuid2cpuflags
app-portage/eix
app-portage/gentoolkit
dev-util/strace
dev-vcs/git
media-sound/alsa-utils
sys-apps/portage
sys-kernel/gentoo-sources:4.14.14
www-client/firefox
x11-apps/mesa-progs
x11-apps/xset
x11-base/xorg-server
x11-drivers/nvidia-drivers
x11-terms/xfce4-terminal

$ cat /etc/portage/make.conf
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
MAKEOPTS="-j4"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp.ds.karen.hj.se/gentoo/ "
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=y --keep-going --jobs 2 --load-average 8"
ACCEPT_LICENSE="*"
PORTDIR_OVERLAY="/usr/local/portage"
INPUT_DEVICES="evdev"
VIDEO_CARDS="nvidia"
USE="X acpi alsa gif icu idn jpeg mmx png opengl -systemd threads tiff -udisks vaapi vdpau"
CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

$ cat /etc/portage/package.accept_keywords 
=app-emulation/wine-mono-4.7.1
=app-emulation/wine-staging-2.21
=app-eselect/eselect-python-20171204
=dev-lang/rust-1.23.0-r1
=dev-libs/icu-60.2
=dev-libs/nss-3.34.1
=dev-libs/nspr-4.17
=dev-util/cargo-0.24.0
=media-libs/libpng-1.6.34
=sys-kernel/gentoo-sources-4.14.14
=virtual/rust-1.23.0
www-client/firefox
=x11-drivers/nvidia-drivers-390.12
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2018-02-02 15:33:05 UTC
Yep I can reproduce this for sure, and I'm not having any luck finding a workaround.  I assume the issue is with firefox rather than cargo as well, though I've seen something in the logs about a binutils error too....
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2018-02-02 21:24:39 UTC
So with binutils and binutils-libs being the same version, and with USE="multitarget" enabled on both, the build processes as far as the final link of libxul.so and then fails for me with ld exit code 7:

69:56.34     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/r_list.o")
69:56.34     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/r_memory.o")
69:56.34     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/r_replace.o")
69:56.34     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/r_time.o")
69:56.34     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/p_buf.o")
69:56.35     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/util.o")
69:56.35     INPUT("../../media/mtransport/third_party/nrappkit/nrappkit_nrappkit/Unified_c_nrappkit0.o")
69:56.35     INPUT("../../memory/fallible/fallible.o")
69:56.35     INPUT("../../media/psshparser/Unified_cpp_media_psshparser0.o")
69:56.35     INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o")
69:56.35 
69:56.35 collect2: fatal error: ld terminated with signal 7 [Bus error]
69:56.35 compilation terminated.
69:56.35 gmake[4]: *** [/var/tmp/portage/www-client/firefox-58.0.1/work/firefox-58.0.1/config/rules.mk:699: libxul.so] Error 1


So, progress, but not enough.  I'll keep looking.
Comment 7 Morgan Wesström 2018-02-02 22:15:55 UTC
Would you benefit from comparing about:buildconfig from firefox-57.0.4 and firefox-bin-58.0.1? I've been entertaining myself comparing them on my setup in a futile attempt to find vital differences that could explain the problem. This is beyond my own level of expertise though. However, I find differences that spark my curiosity, like -msse -msse2 compiler flags being stripped on my source build of 57.0.4 but still being present on the binary build of 58.0.1. It may not be related to this bug but I'm still curious why there are such differences.
Comment 8 acmondor 2018-02-14 23:29:22 UTC
I too can easily reproduce the issue, so I dug into the problem and found a simple work around.

To get the build to work, just apply this patch:

--- firefox-58.0.1/build/cargo-linker   2017-07-31 10:20:49.000000000 -0600
+++ firefox-58.0.1x/build/cargo-linker  2018-02-14 11:42:30.819829044 -0600
@@ -17,4 +17,7 @@
 #   and not quoting it ensures that either of those arguments is passed
 #   as a separate argument to the actual LD.
 
+#Fix for i686-pc-linux-gnu/bin/ld: internal error (s)
+LD_LIBRARY_PATH=$(echo ${LD_LIBRARY_PATH} | sed "s/\:\/usr\/lib//g")
+

To apply this patch, just copy the above to something like /etc/portage/patches/www-client/firefox-58.0.1/acmondor-cargo-linker.patch

This simple patch removes :/usr/lib from the LD_LIBRARY_PATH enviroment variable set when cargo-linker is called. That path is what causes "../../../i686-pc-linux-gnu/bin/ld: internal error ...".

I have not yet figured out where, how, or why LD_LIBRARY_PATH is set the way it is, but the above fix does work and the resultant firefox seems to behave as expected.
Comment 9 Patrice Levesque 2018-04-03 19:53:34 UTC
Patch in comment #8 is effective as a workaround for me; thanks acmondor.
Comment 10 Juergen Rose 2018-04-05 07:31:36 UTC
I have the same issue in a 32-Bit Virtualbox virtual machine.
Comment 11 Psi 2018-05-01 03:10:26 UTC
This appears to be the same issue (as far as the cause) as Bug 637604.  That bug is also in regards to 'ld' failures during Firefox build due to /usr/lib in LD_LIBRARY_PATH, and also occurs when binutils and binutils-libs are the same version.  That bug had a different error in 'ld' and occurred when the "multitarget" USE flags were mismatched between binutils{,-libs}.  However, problems are still possible (obviously, given this bug) with matched flags.

Cargo sets /usr/lib in LD_LIBRARY_PATH, and this is passed on to the 'cargo-linker' script when cargo invokes it.  Having /usr/lib set in LD_LIBRARY_PATH causes 'ld' to pick up the libbfd-${ver}.so from binutils-libs instead of from binutils proper.  If there is any difference between the libbfd-${ver}.so from binutils vs binutils-libs, 'ld' can s*** the bed.

Attached to Bug 637604 is a patch for dev-util/cargo that fixes the LD_LIBRARY_PATH problem.  It's worked fine for me from cargo-0.20.0 through to current cargo-0.26.0.  It simply tells cargo to add Rust's lib directory to LD_LIBRARY_PATH instead of the redundant (and very broken) /usr/lib.
Comment 12 Jory A. Pratt gentoo-dev 2019-03-31 20:06:28 UTC
Please feel free to reopen and update any bug report that can be duplicated with current esr builds, 60.x. If you feel your feature needs to be re looked at in any of these bugs reopen and update, please attach patches when appropriate. Thank you Mozilla Team