PR78968 add configure check for __cxa_thread_atexit in libc

Message ID 20170106170622.GF2966@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Jan. 6, 2017, 5:06 p.m.
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.

Patch hide | download patch | download mbox

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'