Bug 10937 - gold fails to link glibc
Summary: gold fails to link glibc
Status: RESOLVED WONTFIX
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-10 18:14 UTC by Bernhard Rosenkraenzer
Modified: 2010-03-04 00:16 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2009-11-10 18:14:03 UTC
Trying to build glibc 2.11 with gold (after patching out configure.in's checks for the expected ld 
version) results in

gcc   -nostdlib -nostartfiles -r -o /usr/src/ark/BUILD/libc/build-x86_64-linux/elf/librtld.os '-Wl,-(' 
/usr/src/ark/BUILD/libc/build-x86_64-linux/elf/dl-allobjs.os /usr/src/ark/BUILD/libc/build-x86_64-
linux/elf/rtld-libc.a -lgcc '-Wl,-)' \
                  -Wl,-Map,/usr/src/ark/BUILD/libc/build-x86_64-linux/elf/librtld.os.map
gcc   -nostdlib -nostartfiles -shared -Wl,-z,now        \
                  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,--verbose 2>&1 |  \
                  LC_ALL=C \
                  sed -e '/^=========/,/^=========/!d;/^=========/d'    \
                      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
                  > /usr/src/ark/BUILD/libc/build-x86_64-linux/elf/ld.so.lds
gcc   -nostdlib -nostartfiles -shared -o /usr/src/ark/BUILD/libc/build-x86_64-linux/elf/ld.so                   \
                  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,-z,now    \
                  /usr/src/ark/BUILD/libc/build-x86_64-linux/elf/librtld.os -Wl,--version-
script=/usr/src/ark/BUILD/libc/build-x86_64-linux/ld.map               \
                  -Wl,-soname=ld-linux-x86-64.so.2 -T /usr/src/ark/BUILD/libc/build-x86_64-linux/elf/ld.so.lds
/usr/bin/ld: /usr/src/ark/BUILD/libc/build-x86_64-linux/elf/librtld.os: in function 
_dl_start:rtld.c(.text+0x847): error: undefined reference to '_begin'
collect2: ld returned 1 exit status
Comment 1 Ian Lance Taylor 2009-11-11 06:48:38 UTC
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 2 Rohan Hart 2010-03-04 00:16:42 UTC
There appears to be no corresponding bug against glibc.  Perhaps this one could
be reassigned?