Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561298 - dev-qt/qtquickcontrols compilation fails due to collect2: fatal error: cannot find 'ld'
Summary: dev-qt/qtquickcontrols compilation fails due to collect2: fatal error: cannot...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-23 20:10 UTC by M Ogrodnik
Modified: 2017-12-22 12:52 UTC (History)
0 users

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


Attachments
Build log of qtquickcontrols (build.log,131.75 KB, text/plain)
2015-09-23 20:10 UTC, M Ogrodnik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description M Ogrodnik 2015-09-23 20:10:10 UTC
Created attachment 412678 [details]
Build log of qtquickcontrols

Hello. I am trying to emerge kde-apps/kate, but during compilation phase of a package that is pulled by kate to dependancy graph, namely qtquickcontrols, I get "collect2: fatal error: cannot find 'ld'" few times, then the compilation is terminated. emerge --info is provided below, whole log file is also attached.

-------------------------

$ emerge --info '=dev-qt/qtquickcontrols-5.4.2::gentoo'

Portage 2.2.20.1 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.8.4, glibc-2.21-r1, 4.1.3-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.3-gentoo-x86_64-Genuine_Intel-R-_CPU_U7300_@_1.30GHz-with-gentoo-2.2
KiB Mem:     4022516 total,     51724 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 23 Sep 2015 19:30:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64 ~amd64 ~x86"
ACCEPT_LICENSE="* -@EULA @BINARY-REDISTRIBUTABLE skype-license dlj-1-1 AdobeFlash-11.x"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -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 userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://de-mirror.org/gentoo/ rsync://de-mirror.org/gentoo/ http://de-mirror.org/gentoo/ rsync://gentoo.prz.rzeszow.pl/gentoo http://gentoo.prz.rzeszow.pl ftp://ftp.vectranet.pl/gentoo/ http://ftp.vectranet.pl/gentoo/ rsync://ftp.vectranet.pl/gentoo/ rsync://mirror.bytemark.co.uk/gentoo/ http://mirror.bytemark.co.uk/gentoo/ ftp://mirror.bytemark.co.uk/gentoo/"
LANG="pl_PL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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"
USE="X a52 aac acl acpi adobe-flash alsa amd64 berkdb bindist branding bzip bzip2 cairo cdda cdr cli compressed consolekit cracklib crypt cups dbus declarative dhcp dri dts dvd dvdr emboss encode exif fam fftw firefox flac fluidsynth fortran fortran2003 gadu gdbm gif git glamor gpm gtk gzip hdf5 iconv ipv6 java jpeg kde kipi lastfm lcms ldap libnotify mad midi mms mmx mmxext mng modules moodbar mp3 mp4 mpeg mpeg2 mpeg4pt2 mpi mtp multilib ncurses networkmanager nls nptl ntfs ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds python python2_7 python3_4 qt3support qt4 readline sasl sdl seccomp semantic-desktop session spell sse sse2 ssl startup-notification svg system-sqlite tcpd tiff truetype udev udisks unicode upower usb vorbis wallpapers wifi wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid 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" CPU_FLAGS_X86="mmx mmxext sse sse2" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="pl en de ru jp" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Davide Pesavento (RETIRED) gentoo-dev 2015-09-24 16:02:05 UTC
What's the output of `ls -l /usr/bin/ld*`?
Comment 2 M Ogrodnik 2015-09-25 13:25:04 UTC
 ~ $ ls -l /usr/bin/ld*
lrwxrwxrwx 1 root root    22 09-03 19:03 /usr/bin/ld -> x86_64-pc-linux-gnu-ld
lrwxrwxrwx 1 root root    10 09-15 11:40 /usr/bin/ldapadd -> ldapmodify
-rwxrwxrwx 1 root root 60232 09-15 11:40 /usr/bin/ldapcompare
-rwxrwxrwx 1 root root 60312 09-15 11:40 /usr/bin/ldapdelete
-rwxrwxrwx 1 root root 60296 09-15 11:40 /usr/bin/ldapexop
-rwxrwxrwx 1 root root 68536 09-15 11:40 /usr/bin/ldapmodify
-rwxrwxrwx 1 root root 60232 09-15 11:40 /usr/bin/ldapmodrdn
-rwxrwxrwx 1 root root 60248 09-15 11:40 /usr/bin/ldappasswd
-rwxrwxrwx 1 root root 81016 09-15 11:40 /usr/bin/ldapsearch
-rwxrwxrwx 1 root root 18608 09-15 11:40 /usr/bin/ldapurl
-rwxrwxrwx 1 root root 56152 09-15 11:40 /usr/bin/ldapwhoami
lrwxrwxrwx 1 root root    26 09-03 19:03 /usr/bin/ld.bfd -> x86_64-pc-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root  5758 08-04 18:31 /usr/bin/ldd
-rwxr-xr-x 1 root root  5444 08-04 18:31 /usr/bin/lddlibc4
-rwxr-xr-x 1 root root 26255 09-03 13:33 /usr/bin/lddtree
lrwxrwxrwx 1 root root    27 08-04 20:06 /usr/bin/ld.gold -> x86_64-pc-linux-gnu-ld.gold
-rwxr-xr-x 1 root root 39560 08-04 16:52 /usr/bin/ldrdf
Comment 3 M Ogrodnik 2015-09-25 13:30:50 UTC
In case of "ld" there's a few links. Continuing from previous response:

~ $ ls -l /usr/bin/x86_64-pc-linux-gnu-ld
lrwxrwxrwx 1 root root 31 09-03 19:03 /usr/bin/x86_64-pc-linux-gnu-ld -> /usr/x86_64-pc-linux-gnu/bin/ld

~ $ ls -l /usr/x86_64-pc-linux-gnu/bin/ld
lrwxrwxrwx 1 root root 47 09-03 19:03 /usr/x86_64-pc-linux-gnu/bin/ld -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.25.1/ld
Comment 4 M Ogrodnik 2015-10-08 09:00:16 UTC
Hi,

This might be irrelevant, but maybe kate install flags should be modified so it's dependant on version of qt/KDE (4 vs. 5) used - emerge tried to install the newest version of kde-apps/kate-15.x while it's available for qt5 users (+flagged unstable) and requires additional frameworks (in my system qt usage was unspecified at the moment), but even if -qt5 is specified in USE explicitly, portage suggests kate-15.x regardless. To omit the need of installing frameworks one must specify explicitly the desired version of kate editor; emerge =kde-apps/kate-4.13.3 (at this moment).

The problem of kate is solved in my case, but the problem of emerging qtquickcontrols remains open.

Regards,
M. Ogrodnik
Comment 5 Michael Palimaka (kensington) gentoo-dev 2015-10-08 12:08:24 UTC
What's the output of ld -v ?
Comment 6 Michael Palimaka (kensington) gentoo-dev 2015-10-08 12:10:28 UTC
(In reply to M Ogrodnik from comment #4)
> Hi,
> 
> This might be irrelevant, but maybe kate install flags should be modified so
> it's dependant on version of qt/KDE (4 vs. 5) used - emerge tried to install
> the newest version of kde-apps/kate-15.x while it's available for qt5 users
> (+flagged unstable) and requires additional frameworks (in my system qt
> usage was unspecified at the moment), but even if -qt5 is specified in USE
> explicitly, portage suggests kate-15.x regardless. To omit the need of
> installing frameworks one must specify explicitly the desired version of
> kate editor; emerge =kde-apps/kate-4.13.3 (at this moment).
> 
> The problem of kate is solved in my case, but the problem of emerging
> qtquickcontrols remains open.
> 
> Regards,
> M. Ogrodnik

USE flags don't work like that - they are used to control features of individual packages, not to include/exclude which versions get pulled in.
Comment 7 Davide Pesavento (RETIRED) gentoo-dev 2015-10-17 00:21:14 UTC
(In reply to Michael Palimaka (kensington) from comment #5)
> What's the output of ld -v ?

Please provide this info.

Also, what is /usr/bin/x86_64-pc-linux-gnu-ld.gold? is it a symlink? if so, what does it point to? does the symlink target exist?
Comment 8 M Ogrodnik 2015-11-03 11:44:54 UTC
(In reply to Davide Pesavento from comment #7)
> (In reply to Michael Palimaka (kensington) from comment #5)
> > What's the output of ld -v ?

$ ld -v
GNU ld (Gentoo 2.25.1 p1.1) 2.25.1

> Also, what is /usr/bin/x86_64-pc-linux-gnu-ld.gold? is it a symlink? if so,
> what does it point to? does the symlink target exist?
It is a symlink, its target is:

$ ls -l x86_64-pc-linux-gnu-ld.gold 
lrwxrwxrwx 1 root root 36 08-04 20:06 x86_64-pc-linux-gnu-ld.gold -> /usr/x86_64-pc-linux-gnu/bin/ld.gold

which then points another symlink:

$ ls -l /usr/x86_64-pc-linux-gnu/bin/ld.gold 
lrwxrwxrwx 1 root root 52 08-04 20:06 /usr/x86_64-pc-linux-gnu/bin/ld.gold -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.25.1/ld.gold

And it turns out eventually that target does not exist:

# ls -l /usr/x86_64-pc-linux-gnu/binutils-bin/2.25.1/ld.gold
ls: cannot access /usr/x86_64-pc-linux-gnu/binutils-bin/2.25.1/ld.gold: No such file or directory
Comment 9 Davide Pesavento (RETIRED) gentoo-dev 2015-11-03 13:18:53 UTC
So what's the output of emerge -pv sys-devel/binutils ?
Comment 10 M Ogrodnik 2015-11-07 00:56:42 UTC
(In reply to Davide Pesavento from comment #9)
> So what's the output of emerge -pv sys-devel/binutils ?

# emerge -pv sys-devel/binutils

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

Calculating dependencies... done!
[ebuild   R    ] sys-devel/binutils-2.25.1-r1::gentoo  USE="nls zlib -cxx (-multislot) -multitarget -static-libs {-test} -vanilla" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 11 Davide Pesavento (RETIRED) gentoo-dev 2015-11-07 17:05:42 UTC
You don't have gold (ld.gold) because you built binutils with USE="-cxx". And you probably turned it off *after* emerging qtcore:5, so qt was configured to use gold, and the build system expects to find it (with no fallback) when building the other modules too. I'm not sure I want to support this scenario.

Please attach your /usr/lib64/qt5/mkspecs/qmodule.pri so that I can confirm the above theory.
Comment 12 M Ogrodnik 2015-11-09 01:54:30 UTC
(In reply to Davide Pesavento from comment #11)
> You don't have gold (ld.gold) because you built binutils with USE="-cxx".
> And you probably turned it off *after* emerging qtcore:5, so qt was
> configured to use gold, and the build system expects to find it (with no
> fallback) when building the other modules too. I'm not sure I want to
> support this scenario.
> 
> Please attach your /usr/lib64/qt5/mkspecs/qmodule.pri so that I can confirm
> the above theory.

# cat qmodule.pri 
CONFIG +=  qpa largefile nostrip enable_new_dtags sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2
QT_BUILD_PARTS += libs tools
QT_NO_DEFINES =  ALSA CUPS DBUS EGL EGLFS EGL_X11 EVDEV FONTCONFIG FREETYPE HARFBUZZ IMAGEFORMAT_JPEG IMAGEFORMAT_PNG LIBPROXY MITSHM OPENGL OPENSSL OPENVG PULSEAUDIO SHAPE SSL STYLE_GTK TABLET TSLIB XCURSOR XFIXES XINERAMA XINPUT XKB XRANDR XRENDER XSYNC XVIDEO ZLIB
QT_QCONFIG_PATH = 
host_build {
    QT_CPU_FEATURES.x86_64 =  mmx sse sse2
} else {
    QT_CPU_FEATURES.x86_64 =  mmx sse sse2
}
QT_COORD_TYPE = double
QT_LFLAGS_ODBC   = -lodbc
QMAKE_AR = x86_64-pc-linux-gnu-ar cqs
QMAKE_RANLIB = x86_64-pc-linux-gnu-ranlib
QMAKE_STRIP = x86_64-pc-linux-gnu-strip
QMAKE_OBJDUMP = x86_64-pc-linux-gnu-objdump
QMAKE_LINK = x86_64-pc-linux-gnu-g++
QMAKE_CC = x86_64-pc-linux-gnu-gcc
QMAKE_CXX = x86_64-pc-linux-gnu-g++
QMAKE_CFLAGS = -O2 -pipe
QMAKE_CXXFLAGS = -O2 -pipe
QMAKE_LFLAGS = -Wl,-O1 -Wl,--as-needed
styles += mac fusion windows
DEFINES += QT_NO_MTDEV
QT_CFLAGS_GLIB = -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
QT_LIBS_GLIB = -lgthread-2.0 -pthread -lglib-2.0
QMAKE_INCDIR_LIBUDEV = 
QMAKE_LIBS_LIBUDEV = -ludev
DEFINES += QT_NO_EVDEV
DEFINES += QT_NO_TSLIB
DEFINES += QT_NO_LIBINPUT
sql-drivers = 
sql-plugins =
Comment 13 Ryoto Yayame 2016-12-07 20:49:58 UTC
It actually happened to me too, with dev-qt/qtsvg-5.6.1. I'm trying to reduce my USE flags as much as possible. Sure is a corner case though, particularly since "cxx" is a default USE flag. And searching for the error message leads here with the solution (re-enabling the "cxx" USE flag of sys-devel/binutils, or re-emerging all installed dev-qt/*).

I suppose there could possibly be a warning when emerging binutils with "-cxx", if some dev-qt packages are currently installed...
Comment 14 Michael Palimaka (kensington) gentoo-dev 2017-12-22 12:52:41 UTC
Hopefully this should no longer be a problem since we force the system linker now: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64b2ad10079f4c4931520ef102b35f672ee74d99