TLS configure check question (why assembly?)

Steve Ellcey sellcey@mips.com
Tue Jul 10 15:21:00 GMT 2012


I have noticed that most (all?) of the architecture specific configure
scripts (sysdeps/*/configure.in, ports/sysdeps/*/configure.in) have
a chunk of assembly code in them to verify that the assembler and linker
support thread local storage.

I was wondering why this code is written in assembly language and not
as a C program that uses TLS.  Is it because the C syntax for TLS is
not standardized?   Are the only uses of TLS in glibc written in assembly
language?

The reason I ask is that the mips assembly language code that checks
for TLS does not compile if you build glibc with the -mips16 flag and
I wanted to understand why it is in assembly as opposed to C.

Steve Ellcey
sellcey@mips.com



More information about the Libc-alpha mailing list