Commit 2121a768 by Jason Thorpe Committed by Jason Thorpe

config.gcc (default_use_cxa_atexit): New variable, defaults to no.

* config.gcc (default_use_cxa_atexit): New variable, defaults to no.
(*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*): Set default_use_cxa_atexit
to yes.
* configure.in: Allow default_use_cxa_atexit to determine the
value of DEFAULT_USE_CXA_ATEXIT if not explicitly enabled or
disabled.
* configure: Regenerate.

From-SVN: r67401
parent ccb36e10
2003-06-03 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (default_use_cxa_atexit): New variable, defaults to no.
(*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*): Set default_use_cxa_atexit
to yes.
* configure.in: Allow default_use_cxa_atexit to determine the
value of DEFAULT_USE_CXA_ATEXIT if not explicitly enabled or
disabled.
* configure: Regenerate.
2003-06-03 Douglas B Rupp <rupp@gnat.com> 2003-06-03 Douglas B Rupp <rupp@gnat.com>
* Makefile.in (TEXI_GCC_FILES): Remove vms.texi entry. * Makefile.in (TEXI_GCC_FILES): Remove vms.texi entry.
......
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
# enable_threads_flag Either the name, yes or no depending on whether # enable_threads_flag Either the name, yes or no depending on whether
# threads support was requested. # threads support was requested.
# #
# default_use_cxa_atexit
# "no" by default, can be set to "yes" if a target
# wishes to use __cxa_atexit() by default if the
# $enable___cxa_atexit variable is not set.
#
# gas_flag Either yes or no depending on whether GNU as was # gas_flag Either yes or no depending on whether GNU as was
# requested. # requested.
# #
...@@ -221,6 +226,7 @@ thread_file= ...@@ -221,6 +226,7 @@ thread_file=
gas="$gas_flag" gas="$gas_flag"
gnu_ld="$gnu_ld_flag" gnu_ld="$gnu_ld_flag"
enable_threads=$enable_threads_flag enable_threads=$enable_threads_flag
default_use_cxa_atexit=no
target_gtfiles= target_gtfiles=
need_64bit_hwint= need_64bit_hwint=
...@@ -435,6 +441,14 @@ case $machine in ...@@ -435,6 +441,14 @@ case $machine in
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
;; ;;
esac esac
# NetBSD 2.0 and later provide __cxa_atexit(), which we use by
# default (unless overridden by --disable-__cxa_atexit).
case $machine in
*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
default_use_cxa_atexit=yes
;;
esac
;; ;;
*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*) *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
# This is the place-holder for the generic a.out configuration # This is the place-holder for the generic a.out configuration
......
...@@ -481,14 +481,7 @@ AC_SUBST(enable_multilib) ...@@ -481,14 +481,7 @@ AC_SUBST(enable_multilib)
AC_ARG_ENABLE(__cxa_atexit, AC_ARG_ENABLE(__cxa_atexit,
[ --enable-__cxa_atexit enable __cxa_atexit for C++], [ --enable-__cxa_atexit enable __cxa_atexit for C++],
[], []) [], [])
if test x$enable___cxa_atexit = xyes; then
AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1,
[Define if you want to use __cxa_atexit, rather than atexit, to
register C++ destructors for local statics and global objects.
This is essential for fully standards-compliant handling of
destructors, but requires __cxa_atexit in libc.])
fi
# Enable Multibyte Characters for C/C++ # Enable Multibyte Characters for C/C++
AC_ARG_ENABLE(c-mbchar, AC_ARG_ENABLE(c-mbchar,
[ --enable-c-mbchar enable multibyte characters for C and C++], [ --enable-c-mbchar enable multibyte characters for C and C++],
...@@ -1124,6 +1117,15 @@ if test x$thread_file = x; then ...@@ -1124,6 +1117,15 @@ if test x$thread_file = x; then
fi fi
fi fi
if test x$enable___cxa_atexit = xyes || \
test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then
AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1,
[Define if you want to use __cxa_atexit, rather than atexit, to
register C++ destructors for local statics and global objects.
This is essential for fully standards-compliant handling of
destructors, but requires __cxa_atexit in libc.])
fi
# Look for a file containing extra machine modes. # Look for a file containing extra machine modes.
if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
extra_modes_file='$(srcdir)'/config/${extra_modes} extra_modes_file='$(srcdir)'/config/${extra_modes}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment