bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/10881] New: Multithreading link. Thread-local storage (__thread)


From: YLitvinenko at astana dot oilfield dot slb dot com
Subject: [Bug ld/10881] New: Multithreading link. Thread-local storage (__thread) is not working?
Date: 1 Nov 2009 07:33:59 -0000

Yesterday I tried to build GNU MPFR Library (mpfr-2.4.1) using gcc-3.4.6 and 
binutils-2.20.

During configure phase I got a message:
...
checking for TLS support... no
configure: error: please configure with --disable-thread-safe
...

I prepared a little test program (test_binutils.c) to check GNU ld and SUN ld

cat > test_binutils.c <<EOF
__thread int x = 17;
int main() {
  return x != 17;
}
EOF

I compiled this programm with gcc (gcc-3.4.6)
/usr/gnu/bin/gcc -c -o test_binutils.o test_binutils.c

And then linked this program using the same options and object files.

with GNU ld

/usr/gnu/bin/ld -o gnu_ld /usr/gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crt1.o /
usr/gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crti.o /usr/ccs/lib/values-Xa.o /usr/
gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crtbegin.o test_binutils.o -L/lib -lc /
usr/gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crtend.o /usr/gnu/lib/gcc/i386-pc-
solaris2.11/3.4.6/crtn.o

And with SUN ld

/usr/bin/ld -o sun_ld /usr/gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crt1.o /usr/
gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crti.o /usr/ccs/lib/values-Xa.o /usr/gnu/
lib/gcc/i386-pc-solaris2.11/3.4.6/crtbegin.o test_binutils.o -L/lib -lc /usr/
gnu/lib/gcc/i386-pc-solaris2.11/3.4.6/crtend.o /usr/gnu/lib/gcc/i386-pc-
solaris2.11/3.4.6/crtn.o

When I run these built programs (gnu_ld and sun_ld) I get following results:
$ ./gnu_ld ; echo $?
1
$ ./sun_ld ; echo $?
0

Is this a bug in GNU ld?
I built and checked binutils-2.19.1 with the same result.

SUN ld version:
$ /usr/bin/ld --version
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1683

-- 
           Summary: Multithreading link. Thread-local storage (__thread) is
                    not working?
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: YLitvinenko at astana dot oilfield dot slb dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: i386-pc-solaris2.11
  GCC host triplet: i386-pc-solaris2.11
GCC target triplet: i386-pc-solaris2.11


http://sourceware.org/bugzilla/show_bug.cgi?id=10881

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]