This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Many tests fail when gcc passes --no-add-needed to linker

On Mon, Apr 19, 2010 at 3:15 PM, Ulrich Drepper <> wrote:
> Hash: SHA1
> On 04/19/2010 02:03 PM, H.J. Lu wrote:
>> That is not the case for elf/tst-tls12. It is liked against
> Might be that I missed something. ?I'll look at it again once you fixed
> the linker to handle the other cases.

The problem is

[hjl@gnu-15 needed-1]$ gcc -nostdlib -nostartfiles -o
-Wl,-dynamic-linker=/lib/   -Wl,-z,combreloc -Wl,-z,relro
/export/build/gnu/glibc/build-i686-linux/csu/crti.o `gcc
/export/build/gnu/glibc/build-i686-linux/libc_nonshared.a -lgcc
-Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `gcc
/export/build/gnu/glibc/build-i686-linux/elf/tst-tls1.o: undefined
reference to symbol '___tls_get_addr@@GLIBC_2.3'
/usr/local/bin/ld: note: '___tls_get_addr@@GLIBC_2.3' is defined in
DSO /export/build/gnu/glibc/build-i686-linux/elf/ so try
adding it to the linker command line
/export/build/gnu/glibc/build-i686-linux/elf/ could not
read symbols: Invalid operation
collect2: ld returned 1 exit status

The normal has

[hjl@gnu-15 needed-1]$ cat /usr/lib/
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
GROUP ( /lib/ /usr/lib/libc_nonshared.a  AS_NEEDED (
/lib/ ) )
[hjl@gnu-15 needed-1]$

We don't have "AS_NEEDED ( /lib/ )"  This patch adds it.


Attachment: libc-needed-1.patch
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]