mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-25 19:24:40 +08:00
libgo: Use __USING_SJLJ_EXCEPTIONS__ rather than configure test.
From Eric Botcazou. From-SVN: r223231
This commit is contained in:
parent
f03f953f58
commit
5ea73ae3b8
@ -337,9 +337,6 @@
|
|||||||
/* Define to 1 if you have the `wait4' function. */
|
/* Define to 1 if you have the `wait4' function. */
|
||||||
#undef HAVE_WAIT4
|
#undef HAVE_WAIT4
|
||||||
|
|
||||||
/* Define if the C++ compiler is configured for setjmp/longjmp exceptions. */
|
|
||||||
#undef LIBGO_SJLJ_EXCEPTIONS
|
|
||||||
|
|
||||||
/* Define if the linker support split stack adjustments */
|
/* Define if the linker support split stack adjustments */
|
||||||
#undef LINKER_SUPPORTS_SPLIT_STACK
|
#undef LINKER_SUPPORTS_SPLIT_STACK
|
||||||
|
|
||||||
|
69
libgo/configure
vendored
69
libgo/configure
vendored
@ -828,7 +828,6 @@ enable_version_specific_runtime_libs
|
|||||||
with_libffi
|
with_libffi
|
||||||
with_libatomic
|
with_libatomic
|
||||||
with_system_libunwind
|
with_system_libunwind
|
||||||
enable_sjlj_exceptions
|
|
||||||
'
|
'
|
||||||
ac_precious_vars='build_alias
|
ac_precious_vars='build_alias
|
||||||
host_alias
|
host_alias
|
||||||
@ -1469,8 +1468,6 @@ Optional Features:
|
|||||||
--enable-version-specific-runtime-libs
|
--enable-version-specific-runtime-libs
|
||||||
Specify that runtime libraries should be installed
|
Specify that runtime libraries should be installed
|
||||||
in a compiler-specific directory
|
in a compiler-specific directory
|
||||||
--enable-sjlj-exceptions
|
|
||||||
force use of builtin_setjmp for exceptions
|
|
||||||
|
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||||
@ -11121,7 +11118,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 11124 "configure"
|
#line 11121 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@ -11227,7 +11224,7 @@ else
|
|||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 11230 "configure"
|
#line 11227 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
@ -14667,68 +14664,6 @@ $as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# 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 "${libgo_cv_lib_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 ()
|
|
||||||
{
|
|
||||||
int i __attribute__ ((cleanup (clean)));
|
|
||||||
bar();
|
|
||||||
}
|
|
||||||
|
|
||||||
_ACEOF
|
|
||||||
CFLAGS_hold=$CFLAGS
|
|
||||||
CFLAGS="--save-temps -fexceptions"
|
|
||||||
libgo_cv_lib_sjlj_exceptions=unknown
|
|
||||||
if ac_fn_c_try_compile; then :
|
|
||||||
if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
|
|
||||||
libgo_cv_lib_sjlj_exceptions=yes
|
|
||||||
elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
|
|
||||||
libgo_cv_lib_sjlj_exceptions=no
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
CFLAGS=$CFLAGS_hold
|
|
||||||
rm -f conftest*
|
|
||||||
|
|
||||||
fi
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_lib_sjlj_exceptions" >&5
|
|
||||||
$as_echo "$libgo_cv_lib_sjlj_exceptions" >&6; }
|
|
||||||
|
|
||||||
if test "$enable_sjlj_exceptions" = "auto"; then
|
|
||||||
enable_sjlj_exceptions=$libgo_cv_lib_sjlj_exceptions
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $enable_sjlj_exceptions in
|
|
||||||
yes)
|
|
||||||
|
|
||||||
$as_echo "#define LIBGO_SJLJ_EXCEPTIONS 1" >>confdefs.h
|
|
||||||
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
as_fn_error "unable to detect exception model" "$LINENO" 5
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
for ac_header in sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h
|
for ac_header in sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h
|
||||||
do :
|
do :
|
||||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||||
|
@ -473,56 +473,6 @@ AC_C_BIGENDIAN
|
|||||||
|
|
||||||
GCC_CHECK_UNWIND_GETIPINFO
|
GCC_CHECK_UNWIND_GETIPINFO
|
||||||
|
|
||||||
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],
|
|
||||||
[libgo_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"
|
|
||||||
libgo_cv_lib_sjlj_exceptions=unknown
|
|
||||||
AS_IF([ac_fn_c_try_compile],
|
|
||||||
[if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
|
|
||||||
libgo_cv_lib_sjlj_exceptions=yes
|
|
||||||
elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
|
|
||||||
libgo_cv_lib_sjlj_exceptions=no
|
|
||||||
fi])
|
|
||||||
CFLAGS=$CFLAGS_hold
|
|
||||||
rm -f conftest*
|
|
||||||
])
|
|
||||||
|
|
||||||
if test "$enable_sjlj_exceptions" = "auto"; then
|
|
||||||
enable_sjlj_exceptions=$libgo_cv_lib_sjlj_exceptions
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $enable_sjlj_exceptions in
|
|
||||||
yes)
|
|
||||||
AC_DEFINE(LIBGO_SJLJ_EXCEPTIONS, 1,
|
|
||||||
[Define if the C++ compiler is configured for setjmp/longjmp exceptions.])
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([unable to detect exception model])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS(sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
|
AC_CHECK_HEADERS(sched.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/icmp6.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
|
||||||
|
|
||||||
AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
|
AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
|
||||||
|
@ -141,7 +141,7 @@ __go_check_defer (_Bool *frame)
|
|||||||
|
|
||||||
hdr = (struct _Unwind_Exception *) g->exception;
|
hdr = (struct _Unwind_Exception *) g->exception;
|
||||||
|
|
||||||
#ifdef LIBGO_SJLJ_EXCEPTIONS
|
#ifdef __USING_SJLJ_EXCEPTIONS__
|
||||||
_Unwind_SjLj_Resume_or_Rethrow (hdr);
|
_Unwind_SjLj_Resume_or_Rethrow (hdr);
|
||||||
#else
|
#else
|
||||||
#if defined(_LIBUNWIND_STD_ABI)
|
#if defined(_LIBUNWIND_STD_ABI)
|
||||||
|
Loading…
Reference in New Issue
Block a user