Updates to signal handling detection, enabling vosf for cross-compiled overrides.

This commit is contained in:
bvarner 2017-07-20 18:53:04 -04:00
parent 87ae776a41
commit 2210c87233

View File

@ -1170,7 +1170,6 @@ AC_CACHE_CHECK([whether your system supports Mach exceptions],
#include "../CrossPlatform/vm_alloc.cpp" #include "../CrossPlatform/vm_alloc.cpp"
#include "../CrossPlatform/sigsegv.cpp" #include "../CrossPlatform/sigsegv.cpp"
], [ ], [
sigsegv_recovery=mach
ac_cv_have_mach_exceptions=yes ac_cv_have_mach_exceptions=yes
], ],
ac_cv_have_mach_exceptions=no, ac_cv_have_mach_exceptions=no,
@ -1194,7 +1193,6 @@ AC_CACHE_CHECK([whether your system supports Windows exceptions],
#include "../CrossPlatform/vm_alloc.cpp" #include "../CrossPlatform/vm_alloc.cpp"
#include "../CrossPlatform/sigsegv.cpp" #include "../CrossPlatform/sigsegv.cpp"
], [ ], [
sigsegv_recovery=win32
ac_cv_have_win32_exceptions=yes ac_cv_have_win32_exceptions=yes
], ],
ac_cv_have_win32_exceptions=no, ac_cv_have_win32_exceptions=no,
@ -1223,7 +1221,6 @@ if [[ -z "$sigsegv_recovery" ]]; then
#include "../CrossPlatform/vm_alloc.cpp" #include "../CrossPlatform/vm_alloc.cpp"
#include "../CrossPlatform/sigsegv.cpp" #include "../CrossPlatform/sigsegv.cpp"
], [ ], [
sigsegv_recovery=siginfo
ac_cv_have_asm_extended_signals=yes ac_cv_have_asm_extended_signals=yes
], ],
ac_cv_have_asm_extended_signals=no, ac_cv_have_asm_extended_signals=no,
@ -1254,7 +1251,6 @@ if [[ -z "$sigsegv_recovery" ]]; then
#include "../CrossPlatform/vm_alloc.cpp" #include "../CrossPlatform/vm_alloc.cpp"
#include "../CrossPlatform/sigsegv.cpp" #include "../CrossPlatform/sigsegv.cpp"
], [ ], [
sigsegv_recovery=siginfo
ac_cv_have_extended_signals=yes ac_cv_have_extended_signals=yes
], ],
ac_cv_have_extended_signals=no, ac_cv_have_extended_signals=no,
@ -1268,31 +1264,41 @@ if [[ -z "$sigsegv_recovery" ]]; then
[Define if your system supports extended signals.]) [Define if your system supports extended signals.])
fi fi
dnl Otherwise, check for subterfuges. AC_CACHE_CHECK([whether we then have a subterfuge for your system],
if [[ -z "$sigsegv_recovery" ]]; then ac_cv_have_sigcontext_hack, [
AC_CACHE_CHECK([whether we then have a subterfuge for your system], AC_LANG_SAVE
ac_cv_have_sigcontext_hack, [ AC_LANG_CPLUSPLUS
AC_LANG_SAVE AC_TRY_RUN([
AC_LANG_CPLUSPLUS #define HAVE_SIGCONTEXT_SUBTERFUGE 1
AC_TRY_RUN([ #define CONFIGURE_TEST_SIGSEGV_RECOVERY
#define HAVE_SIGCONTEXT_SUBTERFUGE 1 #include "../CrossPlatform/vm_alloc.cpp"
#define CONFIGURE_TEST_SIGSEGV_RECOVERY #include "../CrossPlatform/sigsegv.cpp"
#include "../CrossPlatform/vm_alloc.cpp" ], [
#include "../CrossPlatform/sigsegv.cpp" ac_cv_have_sigcontext_hack=yes
], [ ],
sigsegv_recovery=sigcontext ac_cv_have_sigcontext_hack=no,
ac_cv_have_sigcontext_hack=yes dnl When cross-compiling, do not assume anything.
], ac_cv_have_sigcontext_hack="$BII_CROSS_HAVE_SIGCONTEXT_SUBTERFUGE"
ac_cv_have_sigcontext_hack=no, )
dnl When cross-compiling, do not assume anything. AC_LANG_RESTORE
ac_cv_have_sigcontext_hack="$BII_CROSS_HAVE_SIGCONTEXT_SUBTERFUGE" ])
) AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
AC_LANG_RESTORE [Define if we know a hack to replace siginfo_t->si_addr member.])
])
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
[Define if we know a hack to replace siginfo_t->si_addr member.])
fi
dnl Resolve and set the proper sigsegv_recovery method...
if [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then
sigsegv_recovery=mach
elif [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then
sigsegv_recovery=win32
elif [[ "x$ac_cv_have_asm_extended_signals" = "xyes" ]]; then
sigsegv_recovery=siginfo
elif [[ "x$ac_cv_have_extended_signals" = "xyes" ]]; then
sigsegv_recovery=siginfo
elif [[ "x$ac_cv_have_sigcontext_hack" = "xyes" ]]; then
sigsegv_recovery=sigcontext
fi
dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler) dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler], AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler],
ac_cv_have_skip_instruction, [ ac_cv_have_skip_instruction, [