]> gcc.gnu.org Git - gcc.git/commitdiff
re PR bootstrap/9249 (bootstrap fails with --enable-__cxa-atexit on Solaris)
authorDara Hazeghi <dhazeghi@yahoo.com>
Sat, 31 Jan 2004 04:18:15 +0000 (04:18 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Sat, 31 Jan 2004 04:18:15 +0000 (20:18 -0800)
2004-01-30  Dara Hazeghi  <dhazeghi@yahoo.com>

        PR bootstrap/9249
        * doc/install.texi: document --enable-__cxa_atexit option.
        * configure.ac: Disable __cxa_atexit if not supported.
        * configure: Regenerate.

From-SVN: r77023

gcc/ChangeLog
gcc/configure
gcc/configure.ac
gcc/doc/install.texi

index 5c7792346dd643ab17c0fe0ee3d8c6aed1b8eef2..6fcea98ff806a41212e821b6f04d2cef8776ebc6 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-30  Dara Hazeghi  <dhazeghi@yahoo.com>
+
+       PR bootstrap/9249
+       * doc/install.texi: document --enable-__cxa_atexit option.
+       * configure.ac: Disable __cxa_atexit if not supported.
+       * configure: Regenerate.
+
 2003-01-30  Daniel Berlin  <dberlin@dberlin.org>
 
        * ggc-zone.c (ggc_free): New function.
index 1c99d896b16589fdd11761d78cd8778a8c848124..a1001bdaa3a51bd711fd7800e1c806a405e8e788 100755 (executable)
@@ -8764,11 +8764,88 @@ fi
 
 if test x$enable___cxa_atexit = xyes || \
    test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then
+   echo "$as_me:$LINENO: checking for __cxa_atexit" >&5
+echo $ECHO_N "checking for __cxa_atexit... $ECHO_C" >&6
+if test "${ac_cv_func___cxa_atexit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char __cxa_atexit (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char __cxa_atexit ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub___cxa_atexit) || defined (__stub_____cxa_atexit)
+choke me
+#else
+char (*f) () = __cxa_atexit;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != __cxa_atexit;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func___cxa_atexit=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func___cxa_atexit=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func___cxa_atexit" >&5
+echo "${ECHO_T}$ac_cv_func___cxa_atexit" >&6
+if test $ac_cv_func___cxa_atexit = yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define DEFAULT_USE_CXA_ATEXIT 1
 _ACEOF
 
+else
+  echo "__cxa_atexit can't be enabled on this target"
+fi
+
 fi
 
 # Look for a file containing extra machine modes.
index c29ddaa37a56c88862fe74beb511feef073d9bd7..33549b0b462b7eb90cd7372f9df34307d6ef2e82 100644 (file)
@@ -1136,11 +1136,13 @@ 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.])
+   AC_CHECK_FUNC(__cxa_atexit,
+       [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.])],
+       echo "__cxa_atexit can't be enabled on this target")
 fi
 
 # Look for a file containing extra machine modes.
index 6dae9c90bd8bcdcb64160d5dbe92127e50f5c703..1f53a99c715a97c9389efff64c640d5bef5dd616 100644 (file)
@@ -939,6 +939,14 @@ option will adjust the ABI for AltiVec enhancements, as well as generate
 AltiVec code when appropriate.  This option is only available for
 PowerPC systems.
 
+@item --enable-__cxa_atexit
+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. This option is currently
+only available on sytems with GNU libc. When enabled, this will cause
+@option{-fuse-cxa-exit} to be passed by default.
+
 @item --enable-target-optspace
 Specify that target
 libraries should be optimized for code space instead of code speed.
This page took 0.11352 seconds and 5 git commands to generate.