diff options
author | Dara Hazeghi <dhazeghi@yahoo.com> | 2004-01-31 04:18:15 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-01-30 20:18:15 -0800 |
commit | 354b7da5e35d8b4266e484d514045a7dc1f624fb (patch) | |
tree | 2a53ef1565cb74aa4f599b89db3379d971e05705 /gcc | |
parent | 9781b6dabd95da9b390eaffe878fb883d10d9e74 (diff) | |
download | gcc-354b7da5e35d8b4266e484d514045a7dc1f624fb.zip gcc-354b7da5e35d8b4266e484d514045a7dc1f624fb.tar.gz gcc-354b7da5e35d8b4266e484d514045a7dc1f624fb.tar.bz2 |
re PR bootstrap/9249 (bootstrap fails with --enable-__cxa-atexit on Solaris)
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rwxr-xr-x | gcc/configure | 77 | ||||
-rw-r--r-- | gcc/configure.ac | 12 | ||||
-rw-r--r-- | gcc/doc/install.texi | 8 |
4 files changed, 99 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c77923..6fcea98 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/configure b/gcc/configure index 1c99d89..a1001bd 100755 --- a/gcc/configure +++ b/gcc/configure @@ -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. diff --git a/gcc/configure.ac b/gcc/configure.ac index c29ddaa..33549b0 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -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. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 6dae9c9..1f53a99 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -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. |