how to tell if gcc supports tls?
Robert P. J. Day
rpjday@mindspring.com
Tue May 8 07:01:00 GMT 2007
On Mon, 7 May 2007, Ian Lance Taylor wrote:
> "Robert P. J. Day" <rpjday@mindspring.com> writes:
>
> > is there a gcc invocation i can run to see if that build has TLS
> > support? thanks.
>
> echo '__thread int i;' > foo.c
> gcc -c foo.c >/dev/null 2>&1
> if test $? != 0; then
> echo no TLS support in gcc
> fi
>
> If you are looking for something else, can you clarify what you are
> looking for?
no, that's exactly what i was after. i built a cross-compile
toolchain using crosstool and, during the step of building the glibc
headers, what i got was:
...
running configure fragment for sysdeps/x86_64/elf
checking for x86-64 TLS support... no <--------- dang!
running configure fragment for nptl/sysdeps/pthread
...
which produced numerous subsequent instances of:
...
In file included from include/tls.h:6,
from sysdeps/unix/sysv/linux/x86_64/sysdep.h:26,
from <stdin>:1:
nptl/sysdeps/x86_64/tls.h:62:3: error: #error "TLS support is required."
...
but the build finished and i got what appears to be a functioning
toolchain. now i just want to see what the state of TLS support is,
and try to figure out how to get around that error.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
More information about the Gcc-help
mailing list