[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#631256: eglibc: ftbfs with binutils-gold: "These critical programs are missing or too old: ld"



Jonathan Nieder wrote:

> eglibc does not build with ld.gold.

Quick update: with minor changes, it builds but the resulting ld.so
segfaults[*].  Almost there.

Regards,
Jonathan

[*] Roland McGrath did some work, available from upstream's
roland/gold-vs-libc branch (currently at a9d20e3d).  I also needed the
following:

-- 8< --
--- i/configure.in
+++ w/configure.in
@@ -1567,10 +1567,8 @@ changequote([,])dnl
   libc_cv_z_relro=no
   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
-    fi
+    # Assume the linker supports -z relro.  Debian linkers do.
+    libc_cv_z_relro=yes
   fi])
       if test "$libc_cv_z_relro" = no; then
 	AC_MSG_ERROR(linker with -z relro support required)
-- >8 --

That gets "configure" to work, but the build fails:

| make[4]: Leaving directory `/home/jrn/src/glibc/time'
| make[3]: Leaving directory `/home/jrn/src/glibc/elf'
| make[2]: *** No rule to make target `/home/jrn/src/glibc/build/shlib.lds', needed by `/home/jrn/src/glibc/build/elf/sotruss-lib.so'.  Stop.
| make[2]: Leaving directory `/home/jrn/src/glibc/elf'
| make[1]: *** [elf/subdir_lib] Error 2
| make[1]: Leaving directory `/home/jrn/src/glibc'
| make: *** [all] Error 2

That's because the "use-default-link = yes" codepath is not well
tested, since ld.bfd uses "use-default-link = no".  Removing the
dependencies

	$(objpfx)sotruss-lib.so: $(common-objpfx)shlib.lds
	$(common-objpfx)linkobj/libc.so: $(common-objpfx)shlib.lds

gets past that hurdle.  Unfortunately it does not succeed at the
moment of truth:

| CPP='gcc -E -x c-header'  /home/jrn/src/glibc/build/elf/ld-linux-x86-64.so.2 --library-path /home/jrn/src/glibc/build:/home/jrn/src/glibc/build/math:/home/jrn/src/glibc/build/elf:/home/jrn/src/glibc/build/dlfcn:/home/jrn/src/glibc/build/nss:/home/jrn/src/glibc/build/nis:/home/jrn/src/glibc/build/rt:/home/jrn/src/glibc/build/resolv:/home/jrn/src/glibc/build/crypt:/home/jrn/src/glibc/build/nptl /home/jrn/src/glibc/build/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /home/jrn/src/glibc/build/sunrpc/xbootparam_prot.T
| Segmentation fault (core dumped)
| make[2]: *** [/home/jrn/src/glibc/build/sunrpc/xbootparam_prot.stmp] Error 139

The backtrace from a core dump is not very helpful.

| #0  0xffffffffffffffff in ?? ()
| #1  0x00002b3feb7a317e in call_init (env=0x7ffffdb60ae0, argv=0x7ffffdb60aa0, argc=7, l=<optimized out>)
|     at dl-init.c:85
| #2  call_init (l=<optimized out>, argc=7, argv=0x7ffffdb60aa0, env=0x7ffffdb60ae0) at dl-init.c:35
| #3  0x00002b3feb7a3266 in _dl_init (main_map=0x2b3feb7b91f8, argc=7, argv=0x7ffffdb60aa0, env=0x7ffffdb60ae0)
|     at dl-init.c:134
| #4  0x00002b3feb796b3a in _dl_start_user () from /home/jrn/src/glibc/build/elf/ld-linux-x86-64.so.2
| #5  0x00007ffffdb61943 in ?? ()
| #6  0x0000000000000007 in ?? ()
| #7  0x00007ffffdb61a82 in ?? ()
| #8  0x00007ffffdb61aaa in ?? ()
| #9  0x00007ffffdb61aad in ?? ()
| #10 0x00007ffffdb61ab8 in ?? ()
| #11 0x00007ffffdb61abb in ?? ()
| #12 0x00007ffffdb61ad3 in ?? ()
| #13 0x00007ffffdb61ad6 in ?? ()
| #14 0x0000000000000000 in ?? ()



Reply to: