This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR78968 add configure check for __cxa_thread_atexit in libc
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Jan 2017 17:06:22 +0000
- Subject: Re: [PATCH] PR78968 add configure check for __cxa_thread_atexit in libc
- Authentication-results: sourceware.org; auth=none
- References: <20170104154256.GA12632@redhat.com>
On 04/01/17 15:42 +0000, Jonathan Wakely wrote:
FreeBSD 11 adds __cxa_thread_atexit to libc, so we should use that
instead of defining our own inferior version. This also avoids
multiple definitions of the symbol.
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.
Tested powerpc64le-linux, committed to trunk.
This adds the check for freebsd cross-compilers. Tested by building
x86_64-unknown-freebsd11.0 on x86_64-uknown-linux-gnu.
Committed to trunk.
commit 5d92bb5541b2d21a8c4e76d9f64f4c1a865e2e92
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Jan 6 17:05:32 2017 +0000
Check for __cxa_thread_atexit for freebsd crosses
PR libstdc++/78968
* crossconfig.m4: Check for __cxa_thread_atexit on *-*-freebsd*.
* configure: Regenerate.
diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
index 8cc788c..a765a18 100644
--- a/libstdc++-v3/crossconfig.m4
+++ b/libstdc++-v3/crossconfig.m4
@@ -132,6 +132,7 @@ case "${host}" in
AC_DEFINE(HAVE_ISINFL)
AC_DEFINE(HAVE_ISNANL)
fi
+ AC_CHECK_FUNCS(__cxa_thread_atexit)
;;
*-hpux*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'