summaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-13 21:15:31 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-13 21:15:31 +0000
commit177cc56cf225e09e18161e72d2f369be27b22119 (patch)
treedc6a0f80d4e52e052312acffbba59b37f142e9ef /libgcc
parentee8d553071a6e314f2b4bab7bfc8a6384cc11bc4 (diff)
downloadgcc-177cc56cf225e09e18161e72d2f369be27b22119.tar.gz
config/
* sjlj.m4: New file. libgcc/ * configure.ac: Include config/sjlj.m4. Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust. * config.in: Regenerate. * configure: Likewise. * config.host: Replace enable_sjlj_exceptions by ac_cv_sjlj_exceptions. libjava/ * configure.ac: Include config/sjlj.m4. Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust. * include/config.h.in: Regenerate. * configure: Likewise. * exception.cc: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__. * stacktrace.cc: Likewise. * include/default-signal.h: Likewise. * sysdep/i386/backtrace.h: Likewise. libobjc/ * configure.ac: Remove manual SJLJ check. * config.h.in: Regenerate. * configure: Likewise. * exception.c: Replace SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__. libstdc++-v3/ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Delete. * configure.ac: Remove GLIBCXX_ENABLE_SJLJ_EXCEPTIONS. * config.h.in: Regenerate. * configure: Likewise. * libsupc++/eh_personality.cc: Replace _GLIBCXX_SJLJ_EXCEPTIONS by __USING_SJLJ_EXCEPTIONS__. * libsupc++/eh_throw.cc: Likewise. * libsupc++/eh_ptr.cc: Likewise. * doc/html/manual/appendix_porting.html: Remove GLIBCXX_ENABLE_SJLJ_EXCEPTIONS * doc/xml/manual/build_hacking.xml: Likewise. * doc/html/manual/configure.html: Remove --enable-sjlj-exceptions. * doc/xml/manual/configure.xml: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223181 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog8
-rw-r--r--libgcc/config.host20
-rw-r--r--libgcc/config.in3
-rw-r--r--libgcc/configure84
-rw-r--r--libgcc/configure.ac62
5 files changed, 46 insertions, 131 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 1b53c4d7cc6..7e99ca6138d 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,11 @@
+2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * configure.ac: Include config/sjlj.m4.
+ Remove manual SJLJ check, add GCC_CHECK_SJLJ_EXCEPTIONS and adjust.
+ * config.in: Regenerate.
+ * configure: Likewise.
+ * config.host: Replace enable_sjlj_exceptions by ac_cv_sjlj_exceptions.
+
2015-05-12 Uros Bizjak <ubizjak@gmail.com>
* libgcov-util.c: Add space between string literal and macro name.
diff --git a/libgcc/config.host b/libgcc/config.host
index d558c383631..925db2910a2 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -499,7 +499,7 @@ hppa*64*-*-linux*)
hppa*-*-linux*)
tmake_file="$tmake_file pa/t-linux t-slibgcc-libgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
@@ -510,7 +510,7 @@ hppa*-*-linux*)
hppa[12]*-*-hpux10*)
tmake_file="$tmake_file pa/t-hpux pa/t-hpux10 t-libgcc-pic t-slibgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
@@ -521,7 +521,7 @@ hppa[12]*-*-hpux10*)
hppa*64*-*-hpux11*)
tmake_file="$tmake_file pa/t-hpux pa/t-pa64 pa/t-stublib t-libgcc-pic t-slibgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
@@ -534,7 +534,7 @@ hppa*64*-*-hpux11*)
hppa[12]*-*-hpux11*)
tmake_file="$tmake_file pa/t-hpux pa/t-stublib t-libgcc-pic t-slibgcc"
# Set the libgcc version number
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
else
tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
@@ -635,7 +635,7 @@ i[34567]86-*-cygwin*)
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
fi
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-dw2-eh"
@@ -654,7 +654,7 @@ x86_64-*-cygwin*)
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
fi
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-seh-eh"
@@ -682,7 +682,7 @@ i[34567]86-*-mingw*)
;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-dw2-eh"
@@ -706,7 +706,7 @@ x86_64-*-mingw*)
;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
- if test x$enable_sjlj_exceptions = xyes; then
+ if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
else
tmake_eh_file="i386/t-seh-eh"
@@ -799,9 +799,9 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux
# with ELF format using glibc 2
# aka the GNU/Linux C library 6.
tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux"
- # If not configured with --enable-sjlj-exceptions, bump the
+ # If not configured with setjmp/longjmp exceptions, bump the
# libgcc version number.
- if test x$enable_sjlj_exceptions != xyes; then
+ if test x$ac_cv_sjlj_exceptions != xyes; then
tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
fi
md_unwind_header=m68k/linux-unwind.h
diff --git a/libgcc/config.in b/libgcc/config.in
index 57fdec1f508..59a79618c0e 100644
--- a/libgcc/config.in
+++ b/libgcc/config.in
@@ -39,9 +39,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if the C compiler is configured for setjmp/longjmp exceptions. */
-#undef LIBGCC_SJLJ_EXCEPTIONS
-
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
diff --git a/libgcc/configure b/libgcc/configure
index e911a9dcb46..ce66d1dd312 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -670,7 +670,6 @@ enable_maintainer_mode
with_build_libsubdir
enable_decimal_float
with_system_libunwind
-enable_sjlj_exceptions
enable_explicit_exception_frame_registration
with_glibc_version
enable_tls
@@ -1308,8 +1307,6 @@ Optional Features:
enable decimal float extension to C. Selecting 'bid'
or 'dpd' choses which decimal floating point format
to use
- --enable-sjlj-exceptions
- force use of builtin_setjmp for exceptions
--enable-explicit-exception-frame-registration
register exception tables explicitly at module
start, for use e.g. for compatibility with
@@ -4539,80 +4536,43 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
fi
-# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
-# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
-# libobjc/configure.ac (for Objective-C).
-# FIXME: This should be centralized in config/sjlj.m4.
-# Check whether --enable-sjlj-exceptions was given.
-if test "${enable_sjlj_exceptions+set}" = set; then :
- enableval=$enable_sjlj_exceptions; case "$enableval" in
- yes|no|auto) ;;
- *) as_fn_error "unknown argument to --enable-sjlj-exceptions" "$LINENO" 5 ;;
- esac
-else
- enable_sjlj_exceptions=auto
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use setjmp/longjmp exceptions" >&5
-$as_echo_n "checking whether to use setjmp/longjmp exceptions... " >&6; }
-if test "${libgcc_cv_lib_sjlj_exceptions+set}" = set; then :
+# Check if the compiler is configured for setjmp/longjmp exceptions.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is configured for setjmp/longjmp exceptions" >&5
+$as_echo_n "checking whether the compiler is configured for setjmp/longjmp exceptions... " >&6; }
+if test "${ac_cv_sjlj_exceptions+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-void bar ();
-void clean (int *);
-void foo ()
+#ifdef __USING_SJLJ_EXCEPTIONS__
+ this will fail
+ #endif
+int
+main ()
{
- int i __attribute__ ((cleanup (clean)));
- bar();
+int i;
+ ;
+ return 0;
}
-
_ACEOF
-CFLAGS_hold=$CFLAGS
-CFLAGS="--save-temps -fexceptions"
-libgcc_cv_lib_sjlj_exceptions=unknown
-if ac_fn_c_try_compile; then :
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=no
- fi
-fi
-CFLAGS=$CFLAGS_hold
-rm -f conftest*
-
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sjlj_exceptions=no
+else
+ ac_cv_sjlj_exceptions=yes
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_lib_sjlj_exceptions" >&5
-$as_echo "$libgcc_cv_lib_sjlj_exceptions" >&6; }
-
-if test "$enable_sjlj_exceptions" = "auto"; then
- enable_sjlj_exceptions=$libgcc_cv_lib_sjlj_exceptions
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
-case $enable_sjlj_exceptions in
-yes)
-
-$as_echo "#define LIBGCC_SJLJ_EXCEPTIONS 1" >>confdefs.h
-
- ;;
-no)
- ;;
-*)
- as_fn_error "unable to detect exception model" "$LINENO" 5
- ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sjlj_exceptions" >&5
+$as_echo "$ac_cv_sjlj_exceptions" >&6; }
# Check whether --enable-explicit-exception-frame-registration was given.
if test "${enable_explicit_exception_frame_registration+set}" = set; then :
enableval=$enable_explicit_exception_frame_registration;
force_explicit_eh_registry=
if test "$enable_explicit_exception_frame_registration" = yes; then
- if test "$enable_sjlj_exceptions" = yes; then
- as_fn_error "Can't enable both of --enable-sjlj-exceptions
- and --enable-explicit-exception-frame-registration" "$LINENO" 5
+ if test $ac_cv_sjlj_exceptions = yes; then
+ as_fn_error "Can't --enable-explicit-exception-frame-registration
+ with setjmp/longjmp exceptions" "$LINENO" 5
fi
force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS
fi
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 48fd5b9abc1..dfabd808d11 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -10,6 +10,7 @@ sinclude(../config/picflag.m4)
sinclude(../config/dfp.m4)
sinclude(../config/unwind_ipinfo.m4)
sinclude(../config/gthr.m4)
+sinclude(../config/sjlj.m4)
AC_PREREQ(2.64)
AC_INIT([GNU C Runtime Library], 1.0,,[libgcc])
@@ -230,59 +231,8 @@ AC_SUBST(fixed_point)
# config.gcc also contains tests of with_system_libunwind.
GCC_CHECK_UNWIND_GETIPINFO
-# The sjlj test is almost duplicated here and in libgo/configure.ac (for C),
-# libstdc++-v3/acinclude.m4 and libjava/configure.ac (for C++), and
-# libobjc/configure.ac (for Objective-C).
-# FIXME: This should be centralized in config/sjlj.m4.
-AC_ARG_ENABLE(sjlj-exceptions,
- AC_HELP_STRING([--enable-sjlj-exceptions],
- [force use of builtin_setjmp for exceptions]),
- [case "$enableval" in
- yes|no|auto) ;;
- *) AC_MSG_ERROR([unknown argument to --enable-sjlj-exceptions]) ;;
- esac],
- [enable_sjlj_exceptions=auto])
-
-AC_CACHE_CHECK([whether to use setjmp/longjmp exceptions],
-[libgcc_cv_lib_sjlj_exceptions],
-[AC_LANG_CONFTEST(
- [AC_LANG_SOURCE([
-void bar ();
-void clean (int *);
-void foo ()
-{
- int i __attribute__ ((cleanup (clean)));
- bar();
-}
-])])
-CFLAGS_hold=$CFLAGS
-CFLAGS="--save-temps -fexceptions"
-libgcc_cv_lib_sjlj_exceptions=unknown
-AS_IF([ac_fn_c_try_compile],
- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
- libgcc_cv_lib_sjlj_exceptions=no
- fi])
-CFLAGS=$CFLAGS_hold
-rm -f conftest*
-])
-
-if test "$enable_sjlj_exceptions" = "auto"; then
- enable_sjlj_exceptions=$libgcc_cv_lib_sjlj_exceptions
-fi
-
-case $enable_sjlj_exceptions in
-yes)
- AC_DEFINE(LIBGCC_SJLJ_EXCEPTIONS, 1,
- [Define if the C compiler is configured for setjmp/longjmp exceptions.])
- ;;
-no)
- ;;
-*)
- AC_MSG_ERROR([unable to detect exception model])
- ;;
-esac
+# Check if the compiler is configured for setjmp/longjmp exceptions.
+GCC_CHECK_SJLJ_EXCEPTIONS
AC_ARG_ENABLE([explicit-exception-frame-registration],
[AC_HELP_STRING([--enable-explicit-exception-frame-registration],
@@ -291,9 +241,9 @@ AC_ARG_ENABLE([explicit-exception-frame-registration],
[
force_explicit_eh_registry=
if test "$enable_explicit_exception_frame_registration" = yes; then
- if test "$enable_sjlj_exceptions" = yes; then
- AC_MSG_ERROR([Can't enable both of --enable-sjlj-exceptions
- and --enable-explicit-exception-frame-registration])
+ if test $ac_cv_sjlj_exceptions = yes; then
+ AC_MSG_ERROR([Can't --enable-explicit-exception-frame-registration
+ with setjmp/longjmp exceptions])
fi
force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS
fi