This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3.1]: thread local storage - what do I need?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "Marshall, Simon" <simon dot marshall at misys dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Fri, 5 Sep 2003 13:50:50 +0200
- Subject: Re: [3.3.1]: thread local storage - what do I need?
- References: <FC3DA3DC8D4AD311AB910020352A8FDC10755542@eagle.midas-kapiti.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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