This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: [3.3.1]: thread local storage - what do I need?


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


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