[openssl-dev] [openssl-team] Discussion: design issue: async and -lpthread

Kurt Roeckx kurt at roeckx.be
Mon Nov 23 22:08:32 UTC 2015


On Mon, Nov 23, 2015 at 02:48:25PM -0600, Nico Williams wrote:
> 
> I use this in an autoconf project (I know, OpenSSL doesn't use autoconf):
> 
>   dnl Thread local storage
>   have___thread=no
>   AC_MSG_CHECKING(for thread-local storage)
>   AC_LINK_IFELSE([AC_LANG_SOURCE([
>   static __thread int x ;
>   int main () { x = 123; return x; }
>   ])], have___thread=yes)
>   if test $have___thread = yes; then
>      AC_DEFINE([HAVE___THREAD],1,[Define to 1 if the system supports __thread])
>   fi
>   AC_MSG_RESULT($have___thread)
> 
> Is there something wrong with that that I should know?  I suppose the
> test could use threads to make real sure that it's getting thread-
> locals, in case the compiler is simply ignoring __thread.  Are there
> compilers that ignore __thread??

I think that we currently don't do any compile / link test to
detect features but that we instead explicitly say so for each
platform.

Anyway, the gcc the documentation is here:
https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html

TLS support clearly isn't supported everywhere.


Kurt



More information about the openssl-dev mailing list