[3.3.1]: thread local storage - what do I need?
Jakub Jelinek
jakub@redhat.com
Fri Sep 5 14:01:00 GMT 2003
On Fri, Sep 05, 2003 at 02:40:18PM +0100, Marshall, Simon wrote:
> Hi, I've been trying to use the thread local storage "__thread"
> attribute with gcc (i686-pc-linux-gnu/3.3.1) and SuSE 8.2 (Linux
> 2.4.20-4GB) on a PIII box without any success. The GCC manual says TLS
> requires support from ld, ld.so, libc.so and libpthread.so, but I cannot
> find out exactly what I need, whether I have it and how I get it.
You want a recent glibc 2.3.2 CVS configured with TLS support (either
NPTL or linuxthreads --with-tls), recent gdb and recent binutils.
You can build all of this yourself, or e.g. Red Hat Linux 9 (or better
Severn beta/Taroon beta) should contain the whole toolchain you need.
> gcc -g -D_REENTRANT -fpic -W -L. -l__thread -lpthread __threadmain.cpp
> ./lib__thread.so: undefined reference to `___tls_get_addr'
> collect2: ld returned 1 exit status
>
> Does this mean I don't have the necessary support for TLS? What do I
Yeah, your glibc doesn't support it and neither does gdb.
Jakub
More information about the Gcc
mailing list