diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-01-04 15:41:19 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-01-04 15:41:19 +0000 |
commit | 2a792efe7f9c17b3a89a1e281cb9cbe814c91e16 (patch) | |
tree | 52babbbb68a075e8473afde80cbb3ed10f55d769 | |
parent | 4bf07f3f5fb4fefa2702eced2291ee5d9cb5ad48 (diff) | |
download | gcc-2a792efe7f9c17b3a89a1e281cb9cbe814c91e16.zip gcc-2a792efe7f9c17b3a89a1e281cb9cbe814c91e16.tar.gz gcc-2a792efe7f9c17b3a89a1e281cb9cbe814c91e16.tar.bz2 |
PR78968 add configure check for __cxa_thread_atexit in libc
PR libstdc++/78968
* config.h.in: Regenerate.
* configure: Likewise.
* configure.ac: Check for __cxa_thread_atexit.
* libsupc++/atexit_thread.cc [_GLIBCXX_HAVE___CXA_THREAD_ATEXIT]:
Don't define __cxa_thread_atexit if libc provides it.
From-SVN: r244057
-rw-r--r-- | libstdc++-v3/ChangeLog | 9 | ||||
-rw-r--r-- | libstdc++-v3/config.h.in | 3 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 10 | ||||
-rw-r--r-- | libstdc++-v3/configure.ac | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/atexit_thread.cc | 6 |
5 files changed, 24 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d0bd7e6..10f362b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2017-01-04 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/78968 + * config.h.in: Regenerate. + * configure: Likewise. + * configure.ac: Check for __cxa_thread_atexit. + * libsupc++/atexit_thread.cc [_GLIBCXX_HAVE___CXA_THREAD_ATEXIT]: + Don't define __cxa_thread_atexit if libc provides it. + 2017-01-04 Ville Voutilainen <ville.voutilainen@gmail.com> Implement 2801, Default-constructibility of unique_ptr. diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 41ad510..cdd313b 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -700,6 +700,9 @@ /* Define to 1 if you have the `_tanl' function. */ #undef HAVE__TANL +/* Define to 1 if you have the `__cxa_thread_atexit' function. */ +#undef HAVE___CXA_THREAD_ATEXIT + /* Define to 1 if you have the `__cxa_thread_atexit_impl' function. */ #undef HAVE___CXA_THREAD_ATEXIT_IMPL diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index be6763a..8f92646 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -28031,12 +28031,14 @@ $as_echo "#define HAVE_TLS 1" >>confdefs.h fi - for ac_func in __cxa_thread_atexit_impl + for ac_func in __cxa_thread_atexit_impl __cxa_thread_atexit do : - ac_fn_c_check_func "$LINENO" "__cxa_thread_atexit_impl" "ac_cv_func___cxa_thread_atexit_impl" -if test "x$ac_cv_func___cxa_thread_atexit_impl" = x""yes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE___CXA_THREAD_ATEXIT_IMPL 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 3d61771..f2f6e0a 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -255,7 +255,7 @@ if $GLIBCXX_IS_NATIVE; then # For TLS support. GCC_CHECK_TLS - AC_CHECK_FUNCS(__cxa_thread_atexit_impl) + AC_CHECK_FUNCS(__cxa_thread_atexit_impl __cxa_thread_atexit) AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) # For iconv support. diff --git a/libstdc++-v3/libsupc++/atexit_thread.cc b/libstdc++-v3/libsupc++/atexit_thread.cc index da63368..923a070 100644 --- a/libstdc++-v3/libsupc++/atexit_thread.cc +++ b/libstdc++-v3/libsupc++/atexit_thread.cc @@ -30,7 +30,11 @@ #include <windows.h> #endif -#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL +#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT + +// Libc provides __cxa_thread_atexit definition. + +#elif _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL extern "C" int __cxa_thread_atexit_impl (void (*func) (void *), void *arg, void *d); |