+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.
/* 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
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
# 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.
#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);