diff options
author | Florian Weimer <fweimer@redhat.com> | 2015-10-06 21:27:55 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2015-10-06 21:27:55 +0200 |
commit | 99e1dc0a688d6c25d3f422bc9f3fa29adb483339 (patch) | |
tree | 425b9d0a7670515c8ca8cbbbde0717a1fa180b96 /configure.ac | |
parent | 6c9678ebd42358f931100130a368fafe375a0ba2 (diff) | |
download | glibc-99e1dc0a688d6c25d3f422bc9f3fa29adb483339.tar.gz glibc-99e1dc0a688d6c25d3f422bc9f3fa29adb483339.tar.xz glibc-99e1dc0a688d6c25d3f422bc9f3fa29adb483339.zip |
Add a test case for C++11 thread_local support
This requires a C++ compiler with thread_local support, and a new configure check is needed.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 95d700e835..75a3a77677 100644 --- a/configure.ac +++ b/configure.ac @@ -1982,6 +1982,39 @@ if test $libc_cv_builtin_trap = yes; then AC_DEFINE([HAVE_BUILTIN_TRAP]) fi +dnl C++ feature tests. +AC_LANG_PUSH([C++]) + +AC_CACHE_CHECK([whether the C++ compiler supports thread_local], + libc_cv_cxx_thread_local, [ +old_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS -std=gnu++11" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#include <thread> + +// Compiler support. +struct S +{ + S (); + ~S (); +}; +thread_local S s; +S * get () { return &s; } + +// libstdc++ support. +#ifndef _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL +#error __cxa_thread_atexit_impl not supported +#endif +])], + [libc_cv_cxx_thread_local=yes], + [libc_cv_cxx_thread_local=no]) +CXXFLAGS="$old_CXXFLAGS" +]) +AC_SUBST(libc_cv_cxx_thread_local) + +AC_LANG_POP([C++]) +dnl End of C++ feature tests. + ### End of automated tests. ### Now run sysdeps configure fragments. |