Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 269274

Summary: sys-libs/glibc is unable to detect version of gold linker
Product: Gentoo Linux Reporter: Chris Smith <chris>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Severity: normal CC: astralstorm, bug, dilfridge, ecyoung, esigra, gentoo-bugs, gentoo, genzilla, hasufell, mmokrejs, oas, plaes, polidevk.polidevk
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 269315    
Attachments: sys-libs:glibc-2.9_p20081201-r2:20090510-174545.log
config.log patch for ld
configure patch for ld
glibc modded ebuild patch for glibc-2.10
configure patch for glibc-2.10

Description Chris Smith 2009-05-10 15:36:52 UTC
glibc-2.9_p20081201-r2 fails configure when binutils- is built with the gold USE flag.

Reproducible: Always

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

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]

emerge --info
Portage (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/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe -floop-interchange -floop-strip-mine -floop-block"
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"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
LINGUAS="en_US en"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/usr/local/portage/layman/gnome /usr/local/portage/layman/graaff /usr/local/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"
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]

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..., 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..., 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- 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
*  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] 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] 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 (default/linux/amd64/10.0/no-multilib, gcc-4.4.2, glibc-2.9_p20081201-r2, x86_64)
System uname: Linux-
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
CFLAGS="-O2 -pipe -march=native -mfpmath=sse -fomit-frame-pointer -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1"
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"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
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"
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
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):

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. ***