TLS autodetection support in the X server

tom fogal tfogal at
Wed Jan 5 10:58:21 PST 2011

Hi Dan,

I had accidently dropped xorg from the cc list, and have added it back
now.  I imagine you thought it was going there anyway... but I'm very
sorry if you intended this to be private.

Dan Nicholson <dbn.lists at> writes:
> > From bd2e4d98551a4cfa375b155d685bef4e5552b8b0 Mon Sep 17 00:00:00 2001
> > From: Tom Fogal <tfogal at>
> > Date: Wed, 22 Dec 2010 16:03:03 -0700
> > Subject: [PATCH 1/2] Add macro for detecting thread local storage support.
> > 
> > This adds an AX_TLS macro which attempts to identify if the
> > underlying compiler/platform supports thread local storage (TLS).
> > The macro comes from the autoconf macro archive.
> First patch,
> Reviewed-by: Dan Nicholson <dbn.lists at>


> > From f6f4dcbfa4d4527c65cd67d1b39d799e56f3dd89 Mon Sep 17 00:00:00 2001
> > From: Tom Fogal <tfogal at>
> > Date: Wed, 22 Dec 2010 14:39:48 -0700
> > Subject: [PATCH 2/2] Autodetect TLS support instead of defaulting to disabl
> ed.
> > 
> > Uses the AX_TLS macro to figure out if the current platform
> > supports TLS.  If it does, enable TLS automagically.  Still
> > respects --enable option, regardless.
> > -                                [GLX_USE_TLS=no])
> > +                                [GLX_USE_TLS=no
> > +                                 if test "${ac_cv_tls}" != "none" ; then
> > +                                   GLX_USE_TLS=yes
> > +                                 fi])
> Is that AC_SUBST being used for anything? I don't see GLX_TLS used
> anywhere.

No, it isn't.  I carried it over because I half-expected someone to
say, "it would be nice if dependent package Y had a way of figuring
out if the xserver was built with TLS, could you export it in a .pc?"
for some package Y that I have little to no knowledge of.  That never
happened, and I forgot about it; I'll remove the subst when I post the
final patch.

> Besides that:  Reviewed-by: Dan Nicholson <dbn.lists at>


> As far as the Mesa side goes, I'd still like to see the TLS property
> exported from dri.pc or gl.pc.

Okay, I'll post a patch that does that and only that to mesa-dev soon.
Since it's not changing much, I don't think they'll be any objections.

> Furthermore, we might want to try the same TLS treatment on the Mesa
> loader and autodetection of TLS for the drivers.

Yes, that's really my goal, I just jumped into the X server because the
way to get there wasn't paved, yet :)

Thanks again,


More information about the xorg-devel mailing list