Howto enable thread-local storage?



How does one enable thread-local storage?

I'm in the process of adding an updated glibc to my system (with prefix
/usr/local/glibc2.4/, so not to break anything using the old glibc that
came with this redhat box.)

First, I had to get the newest GCC, version 4.1.1, so I compiled it with
this configure line:

../gcc/configure --prefix=/usr/local/gcc4 --enable-threads=posix

It built, and make install then succeeded and from there, I went to
build glibc 2.4:

../glibc-2.4/configure --prefix=/usr/local/glibc2.4 --enable-addons
CC=/usr/local/gcc4/bin/gcc

In the the middle of the "checking" list I noticed "checking for
__thread... no" but it keeps going until this:


checking for __thread... no
.
.
.
checking for i386 TLS support... no
running configure fragment for nptl/sysdeps/pthread
configure: error: compiler support for __thread is required

Ok, and I've bene furiously search both google web and groups for how to
enable TLS (thread-local storage), as this is basically the test
configure performs that fails:

$ echo '__thread int a;' | /usr/local/gcc4/bin/gcc -xc - -S -o test
<stdin>:1: error: thread-local storage not supported for this target

Same if I try to compile the following:
(temp.c)
__thread int i;

int main() {
return 0;
}

I get the same error (as the code is basically the same):
$ /usr/local/gcc4/bin/gcc temp.c -o temp
temp.c:1: error: thread-local storage not supported for this target

I found a google groups post,
http://groups.google.com/group/gnu.gcc.help/tree/browse_frm/thread/f23644e07b21516e?fwc=1#doc_2beeb26e6449dfcf
that seems to suggest that suppost is needed in the assembler. I'm not
sure if this is the case, but if it is, how/where do I get a nnew
assembler. I searched aroudn but really got no where.

Thanks for any help.

# uname -a
Linux ***** 2.4.20-20.7 #1 Mon Aug 18 14:56:30 EDT 2003 i686 unknown

--
Stan


.



Relevant Pages

  • How to enable thread-local storage?
    ... How does one enable thread-local storage? ... I'm in the process of adding an updated glibc to my system (with prefix ... that seems to suggest that suppost is needed in the assembler. ...
    (comp.os.linux.misc)
  • How to enable thread-local storage
    ... How does one enable thread-local storage? ... I'm in the process of adding an updated glibc to my system (with prefix ... that seems to suggest that suppost is needed in the assembler. ...
    (alt.os.linux.redhat)
  • How to enable thread-local storage support?
    ... How does one enable thread-local storage? ... I'm in the process of adding an updated glibc to my system (with prefix ... that seems to suggest that suppost is needed in the assembler. ...
    (comp.unix.admin)
  • Howto enable thread-local storage?
    ... How does one enable thread-local storage? ... I'm in the process of adding an updated glibc to my system (with prefix ... that seems to suggest that suppost is needed in the assembler. ...
    (linux.redhat)
  • How to enable thread-local storage?
    ... How does one enable thread-local storage? ... I'm in the process of adding an updated glibc to my system (with prefix ... that seems to suggest that suppost is needed in the assembler. ...
    (linux.redhat.install)