Bug#631256: eglibc: ftbfs with binutils-gold: "These critical programs are missing or too old: ld"
Source: eglibc
Version: 2.13-7
Tags: upstream
Hi,
I believe this is already a well known problem and don't expect
anything to happen, but am filing it for reference. eglibc does not
build with ld.gold. There are multiple superficial reasons for
that[*] but when it comes down to it, it is because configure.in
expects "gcc -Wl,--verbose" to write a linker script and ld.gold
neither uses linker scripts internally[**] nor knows how to fake them.
Luckily, there is a simple workaround --- ld.bfd works fine.
Regards,
Jonathan
[*]
| $ debian/rules build
[...]
| checking version of as... 2.21.52.20110606, ok
| checking for ld... ld
| checking version of ld... v. ?.??, bad
[...]
| configure: error:
| *** These critical programs are missing or too old: ld
| *** Check the INSTALL file for required versions.
| make: *** [/home/jrn/src/glibc-work/stamp-dir/configure_libc] Error 1
Wha? glibc only wants ld 2.17 or later. This is just a mini-bug ---
the version check hardcodes ld.bfd-style's version string and gold
does not match.
| AC_CHECK_PROG_VER(LD, $LD, --version,
| [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
| [2.1[7-9]*|2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld")
| $ ld --version | head -1
| GNU gold (GNU Binutils for Debian 2.21.52.20110606) 1.11
No problem --- loosen the pattern to match. Next:
| checking for -z initfirst option... yes
| checking for -z relro option... no
| configure: error: linker with -z relro support required
| make: *** [/home/jrn/src/glibc-work/stamp-dir/configure_libc] Error 1
But... ld.gold advertises relro support.
| $ ld --help | grep relro
| -z relro Where possible mark variables read-only after relocation
| -z norelro Don't mark variables read-only after relocation
Unfortunately, the configure script checks for it by reading the
linker script, and unlike ld.bfd, ld.gold does not write a linker
script when passed the --verbose option.
| if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
| then
| if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
| then
| libc_cv_z_relro=yes
| $ ld --verbose
| ld: fatal error: no input files
With that hint, it's easy to find other places that read linker
scripts for other purposes.
[**] http://www.airs.com/blog/archives/138
Reply to: