lipthread and TLS

Kip Macy kip.macy at
Thu Mar 22 18:24:54 UTC 2007

On 3/22/07, Daniel Eischen <deischen at> wrote:
> On Thu, 22 Mar 2007, Jason Evans wrote:
> > Daniel Eischen wrote:
> >> The toolchain itself should support TLS, so that's probably
> >> the place to look, as well as src/libexec/rtld-elf/.  The
> >> libpthread library does not use TLS itself, and I don't
> >> think anything (yet) uses TLS in libc or in our base system,
> >> though I could be wrong.
> >
> > malloc uses TLS.
> Well, I stand corrected then.  If you need to get MIPS up
> and running without TLS, you may need to hack malloc()
> and anything else that uses TLS to temporarily use
> pthread_[gs]etspecific()...

You won't be able to use TLS unless:
a) initialization works in libc - it was broken on sparc64 until
recently for both static and dynamic linking
b) your linker supports it - the current binutils is very much out of
date, users needing it will have to build a private toolchain

More information about the freebsd-threads mailing list