Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269274 - sys-libs/glibc is unable to detect version of gold linker
Summary: sys-libs/glibc is unable to detect version of gold linker
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://sourceware.org/ml/binutils/200...
Whiteboard:
Keywords:
: 406879 412023 429282 430896 459888 544194 (view as bug list)
Depends on:
Blocks: systemwide-gold
  Show dependency tree
 
Reported: 2009-05-10 15:36 UTC by Chris Smith
Modified: 2015-03-27 22:23 UTC (History)
13 users (show)

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


Attachments
sys-libs:glibc-2.9_p20081201-r2:20090510-174545.log (sys-libs:glibc-2.9_p20081201-r2:20090510-174545.log,13.53 KB, text/plain)
2009-05-10 17:50 UTC, Chris Smith
Details
config.log (config.log,17.91 KB, text/plain)
2009-05-10 18:11 UTC, Chris Smith
Details
configure.in patch for ld (glibc_configure.in_use-gold-linker-version-regex.patch,623 bytes, patch)
2009-05-15 13:13 UTC, Fabio Scaccabarozzi
Details | Diff
configure patch for ld (glibc-configure-use-gold-linker-version-regex.patch,705 bytes, patch)
2009-05-15 13:13 UTC, Fabio Scaccabarozzi
Details | Diff
glibc modded ebuild (glibc-2.9_p20081201-r2.ebuild,7.78 KB, text/plain)
2009-05-15 13:13 UTC, Fabio Scaccabarozzi
Details
configure.in patch for glibc-2.10 (glibc-2.10-configure.in.patch,918 bytes, patch)
2009-10-28 22:33 UTC, Lóránt Farkas
Details | Diff
configure patch for glibc-2.10 (glibc-2.10-configure.patch,960 bytes, patch)
2009-10-28 22:40 UTC, Lóránt Farkas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2009-05-10 15:36:52 UTC
glibc-2.9_p20081201-r2 fails configure when binutils-2.19.51.0.4 is built with the gold USE flag.

Reproducible: Always

Steps to Reproduce:
1.build binutils-2.19.51.0.4 w/gold
2.emerge glibc-2.9_p20081201-r2
3.

Actual Results:  
checking for sed... sed
checking version of sed... 4.1.5, ok
checking for autoconf... autoconf
checking whether autoconf works... yes
configure: error:
*** These critical programs are missing or too old: ld



fails both on amd64 and x86
Comment 1 Sebastian Luther (few) 2009-05-10 16:23:06 UTC
Please provide emerge --info and attach the config.log.
Comment 2 Chris Smith 2009-05-10 17:50:19 UTC
Created attachment 190857 [details]
sys-libs:glibc-2.9_p20081201-r2:20090510-174545.log

emerge --info
Portage 2.1.6.13 (default/linux/amd64/2008.0, gcc-4.4.0, glibc-2.9_p20081201-r2, 2.6.29-gentoo-r3 x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-r3-x86_64-Intel-R-_Core-TM-2_CPU_6600_@_2.40GHz-with-gentoo-2.0.0
Timestamp of tree: Sun, 10 May 2009 15:45:01 +0000
app-shells/bash:     4.0_p17-r1
dev-java/java-config: 2.1.7
dev-lang/python:     2.6.2
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.51.0.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe -floop-interchange -floop-strip-mine -floop-block"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /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 /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -fomit-frame-pointer -pipe -floop-interchange -floop-strip-mine -floop-block"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://gentoo.mirrors.tds.net/gentoo http://gentoo.cites.uiuc.edu/pub/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ http://gentoo.chem.wisc.edu/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="en_US en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/gnome /usr/local/portage/layman/graaff /usr/local/portage"
SYNC="rsync://davinci.realcomputerguy.soho/gentoo-portage"
USE="X a52 aac aalib acl acpi addressbook alsa amd64 amr apache2 audiofile avahi avi bash-completion berkdb bzip2 cairo caps cdaudio cdparanoia cdr chm cli cracklib crypt cups curl dbus designer-plugin djvu dri dts dv dvb dvd dvdr dvdread ebook encode exif fam ffmpeg flac fortran gdbm gif glitz gmp gnome gphoto2 gpm gps graphite gstreamer gtk gtk2 hal htmlhandbook iconv ieee1394 imagemagick imap imlib ipv6 isdnlog jack java jpeg jpeg2k kpathsea lame lcd lcms ldap libnotify mad marble midi mmap mmx mozcalendar mozilla mp3 mudflap multilib musicbrainz ncurses nepomuk nls nodrm nptl nptlonly nsplugin nvidia ofx ogg oggvorbis openexr opengl openmp pam pcre pdf perl png pppd pulseaudio python qt3 qt4 quicktime readline reflection samba sasl scanner sdl semantic-desktop session slp smp sndfile spell spl sse sse2 ssl subversion svg sysfs tcltk theora threads tiff tk transparency truetype unicode usb utf8 v4l v4l2 vcd vim-syntax vorbis wav wavpack wmf x264 xattr xcomposite xine xml xorg xscreensaver xv xvid xvmc zlib" ALSA_CARDS="hda-intel hdsp" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US en" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa fbdev vmware v4l"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Chris Smith 2009-05-10 17:52:25 UTC
(In reply to comment #1)
> Please provide emerge --info and attach the config.log.
> 
config.log is not to be found in the work dir
Comment 4 Sebastian Luther (few) 2009-05-10 18:01:23 UTC
"find . |grep config.log" does not return anything inside the work dir?
Comment 5 Chris Smith 2009-05-10 18:11:28 UTC
Created attachment 190859 [details]
config.log

ah yes, it is there...I was looking in the work/glibc-2.9-20081201 directory
Comment 6 Kamen Dokov 2009-05-11 11:43:25 UTC
Me too on amd64! Sending  "gold" back in the closet for now ;)
Comment 7 Kamen Dokov 2009-05-11 12:25:33 UTC
P.S. sys-boot/grb-1.96 also fails  configure with the "gold" binuils :





checking whether x86_64-pc-linux-gnu-objcopy works for absolute addresses... configure: error: x86_64-pc-linux-gnu-gcc cannot link at address 7C00
Comment 8 Fabio Scaccabarozzi 2009-05-15 13:12:18 UTC
I've been debugging/patching for the last 2 hours... finally I got the sed regex to substitute (which was driving me insane, being a sed newbie):
[...]
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/as... /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/as                          
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/as... 2.19.51.0.4.20090418, ok                                                                        
checking for /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/ld... /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/ld                          
checking version of /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/ld... 2.19.51.0.4.20090418, ok                                                                        
checking for pwd... /bin/pwd                                                                                                                                                                         
checking for i686-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc                                                                                                                               
checking version of x86_64-pc-linux-gnu-gcc... 4.3.3, ok
[...]

Sad is, it throws another error:
[...after log above]
checking for .preinit_array/.init_array/.fini_array support... yes
checking for libunwind-support in compiler... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -z relro option... no
configure: error: linker with -z relro support required

even if `ld --help` shows:
  -z relro                    Where possible mark variables read-only after relocation

I'm on binutils-2.19.51.0.4.20090418. I'm attaching the two patches I made plus the modded ebuild (which does nothing except patching in eblit-src_unpack-post).
I'm stuck with that error above.. and I don't know where to put my hands this time, since it should work as usual.
Note that this ebuild patches if the gold USE flag is set in binutils, but if we have binutils-2.18.x + gold USE flag this patch gets applied anyway, which is not correct since 2.18.x exhibit old version tag even with gold USE flag:

fabio@gentoo-node1 ~ $ ld -v
GNU ld (GNU Binutils) 2.18
fabio@gentoo-node1 ~ $ emerge -s binutils
Searching...
*  sys-devel/binutils
      Latest version available: 2.18-r3
      Latest version installed: 2.18-r3

Since I'm not used to ebuild hacking (not at this level at least) and I'm not aware of any function to verify an installed version of a program, I'm leaving this to developers.. basically it should apply only on >=binutils-2.19.x
Comment 9 Fabio Scaccabarozzi 2009-05-15 13:13:02 UTC
Created attachment 191358 [details, diff]
configure.in patch for ld
Comment 10 Fabio Scaccabarozzi 2009-05-15 13:13:19 UTC
Created attachment 191360 [details, diff]
configure patch for ld
Comment 11 Fabio Scaccabarozzi 2009-05-15 13:13:56 UTC
Created attachment 191362 [details]
glibc modded ebuild

Lacks binutils version checking
Comment 12 Priit Laes (IRC: plaes) 2009-10-18 11:27:05 UTC
Also glibc-2.10.1 fails with gold :(
Comment 13 Lóránt Farkas 2009-10-28 22:33:42 UTC
Created attachment 208584 [details, diff]
configure.in patch for glibc-2.10

The previous patch was not perfect. A "\" was missing before "/" and the version of glod linker was not the same as the binutils so the configure script detected as "too old".
Comment 14 Lóránt Farkas 2009-10-28 22:40:38 UTC
Created attachment 208585 [details, diff]
configure patch for glibc-2.10
Comment 15 Erik 2009-11-19 07:46:46 UTC
Will portage get a fixed sys-libs/glibc-2.9_p20081201-r2 I can try to build? (Or are we supposed to test the attached ebuild directly first?)

(I assume that this is the case where the -r2 will just be fixed instead of adding a -r3 that everyone has to build, because if it is already built there is no reason to build it again with this kind of fix.)
Comment 16 SpanKY gentoo-dev 2009-11-19 17:30:44 UTC
there are no plans to add configure fixes to glibc as it is understood that the build will fail in other places due to gold

use /etc/portage/patches/ if you want to test things yourself
Comment 17 Erik 2009-11-19 20:58:55 UTC
So what is the plan for gold? Is it to have both gold and classic ld installed, and the packages that depend on classic ld will use it, while the rest use gold? Or is it to wait until gold works with everything and then switch over to it.

I tried gold some months ago and it gave a noticeable improvement. Now I try to do some development on a medium-sized C++ project, but the linking takes several minutes. It is really painful and I could really use some serious improvement. I would prefer to have both kinds of ld installed, get the speed improvement for my development and most packages in portage, while keeping classic ld for glibc and maybe a few more trick packages.
Comment 18 SpanKY gentoo-dev 2009-11-21 03:54:21 UTC
there are no plans.  use it as you see fit.
Comment 19 Alexander Kozyrev 2009-12-04 19:24:14 UTC
i have a similar problem:
glibc-2.9_20081201-r2 configure fails with 
"configure: error:
*** These critical programs are missing or too old: as ld" 
my binutils is classic (not gold)
-------------------------------------------------------------------------
Portage 2.1.6.13 (default/linux/amd64/10.0/no-multilib, gcc-4.4.2, glibc-2.9_p20081201-r2, 2.6.31.1 x86_64)
=================================================================
System uname: Linux-2.6.31.1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T9400_@_2.53GHz-with-gentoo-2.0.1
Timestamp of tree: Tue, 01 Dec 2009 00:45:01 +0000
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r1
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r2
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mfpmath=sse -fomit-frame-pointer -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=native -mfpmath=sse -fomit-frame-pointer -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1"
DISTDIR="/srv/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://gentoo.kiev.ua/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LANG="en_US.UTF8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X amd64 mmx mmxext nls nptl opengl pam sse sse2 sse3 sse4_1 ssse3 truetype unicode" 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" ALSA_PCM_PLUGINS="*" APACHE2_MODULES="authz_host dir mime rewrite env" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 20 SpanKY gentoo-dev 2010-04-25 07:26:08 UTC
nothing for us to work on here, and `ld` wont be defaulting to gold any time soon
Comment 21 SpanKY gentoo-dev 2012-03-04 18:36:25 UTC
*** Bug 406879 has been marked as a duplicate of this bug. ***
Comment 22 SpanKY gentoo-dev 2012-04-16 02:42:31 UTC
*** Bug 412023 has been marked as a duplicate of this bug. ***
Comment 23 SpanKY gentoo-dev 2012-08-01 02:20:35 UTC
*** Bug 429282 has been marked as a duplicate of this bug. ***
Comment 24 Andreas K. Hüttel archtester gentoo-dev 2012-08-11 12:49:29 UTC
(In reply to comment #20)
> nothing for us to work on here, and `ld` wont be defaulting to gold any time
> soon

Awesome. Is there an upstream tracker bug somewhere? The linked e-mail is not particularly informative, and tbh sounds only like "we dont care to fix".
Comment 25 Andreas K. Hüttel archtester gentoo-dev 2012-08-11 12:49:57 UTC
*** Bug 430896 has been marked as a duplicate of this bug. ***
Comment 26 SpanKY gentoo-dev 2012-12-25 20:08:46 UTC
Commit message: Force usage of bfd linker if active linker is gold
http://sources.gentoo.org/sys-libs/glibc/files/eblits/src_compile.eblit?r1=1.29&r2=1.30
Comment 27 Jeroen Roovers (RETIRED) gentoo-dev 2013-03-01 17:06:59 UTC
*** Bug 459888 has been marked as a duplicate of this bug. ***
Comment 28 Carter Young 2013-03-01 17:32:48 UTC
From Binutils Bugzilla(in case anyone is redirected here, like me):

http://sourceware.org/bugzilla/show_bug.cgi?id=10937

That part is never going to work with gold.  It is asking the linker for the
default linker script, editing it, and passing it back to the linker.  gold does
not have a default linker script to edit.  Building glibc with gold will require
using a different approach of some sort.
Comment 29 Alex Xu (Hello71) 2015-03-27 22:23:46 UTC
*** Bug 544194 has been marked as a duplicate of this bug. ***