mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-04-03 11:29:33 +00:00
Trying to fix linux/arm build.
This commit is contained in:
parent
23ee14227f
commit
fa7da794c3
@ -1127,8 +1127,36 @@ AC_CACHE_CHECK([whether your system supports Windows exceptions],
|
||||
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
|
||||
[Define if your system supports Windows exceptions.])
|
||||
|
||||
dnl Otherwise, check if extended signals are supported.
|
||||
dnl Otherwise, check if extended signals are supported with <asm/ucontext.h>.
|
||||
if [[ -z "$sigsegv_recovery" ]]; then
|
||||
AC_CACHE_CHECK([whether your system supports extended signal handlers via asm],
|
||||
ac_cv_have_extended_signals, [
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_RUN([
|
||||
#define HAVE_ASM_UCONTEXT 1
|
||||
#define HAVE_SIGINFO_T 1
|
||||
#define CONFIGURE_TEST_SIGSEGV_RECOVERY
|
||||
#include "vm_alloc.cpp"
|
||||
#include "sigsegv.cpp"
|
||||
], [
|
||||
sigsegv_recovery=siginfo
|
||||
ac_cv_have_extended_signals=yes
|
||||
],
|
||||
ac_cv_have_extended_signals=no,
|
||||
dnl When cross-compiling, do not assume anything.
|
||||
ac_cv_have_extended_signals=no
|
||||
)
|
||||
AC_LANG_RESTORE
|
||||
]
|
||||
)
|
||||
AC_TRANSLATE_DEFINE(HAVE_ASM_UCONTEXT, "$ac_cv_have_extended_signals",
|
||||
[Define if your system has <asm/ucontext.h> header.])
|
||||
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
|
||||
[Define if your system supports extended signals.])
|
||||
fi
|
||||
|
||||
if [[ -z "$sigsegv_recovery" -a "x$ac_cv_have_extended_signals" != "xyes" ]]; then
|
||||
AC_CACHE_CHECK([whether your system supports extended signal handlers],
|
||||
ac_cv_have_extended_signals, [
|
||||
AC_LANG_SAVE
|
||||
@ -1150,7 +1178,7 @@ if [[ -z "$sigsegv_recovery" ]]; then
|
||||
]
|
||||
)
|
||||
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
|
||||
[Define if your system support extended signals.])
|
||||
[Define if your system supports extended signals.])
|
||||
fi
|
||||
|
||||
dnl Otherwise, check for subterfuges.
|
||||
|
@ -306,52 +306,47 @@ static void powerpc_decode_instruction(instruction_t *instruction, unsigned int
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__linux__)
|
||||
#if (defined(i386) || defined(__i386__))
|
||||
#if HAVE_ASM_UCONTEXT
|
||||
#include <asm/ucontext.h> /* use kernel structure, glibc may not be in sync */
|
||||
#else
|
||||
#include <sys/ucontext.h>
|
||||
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[14] /* should use REG_EIP instead */
|
||||
#define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS
|
||||
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
|
||||
#endif
|
||||
#if (defined(x86_64) || defined(__x86_64__))
|
||||
#include <sys/ucontext.h>
|
||||
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[16] /* should use REG_RIP instead */
|
||||
#define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS
|
||||
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
|
||||
#endif
|
||||
#if (defined(ia64) || defined(__ia64__))
|
||||
#define SIGSEGV_CONTEXT_REGS ((struct sigcontext *)scp)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION (SIGSEGV_CONTEXT_REGS->sc_ip & ~0x3ULL) /* slot number is in bits 0 and 1 */
|
||||
#define SIGSEGV_REGISTER_FILE SIGSEGV_CONTEXT_REGS
|
||||
#define SIGSEGV_SKIP_INSTRUCTION ia64_skip_instruction
|
||||
#endif
|
||||
#if (defined(powerpc) || defined(__powerpc__))
|
||||
#include <sys/ucontext.h>
|
||||
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.regs)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION (SIGSEGV_CONTEXT_REGS->nip)
|
||||
#define SIGSEGV_REGISTER_FILE (unsigned long *)&SIGSEGV_CONTEXT_REGS->nip, (unsigned long *)(SIGSEGV_CONTEXT_REGS->gpr)
|
||||
#define SIGSEGV_SKIP_INSTRUCTION powerpc_skip_instruction
|
||||
#endif
|
||||
#if (defined(hppa) || defined(__hppa__))
|
||||
#undef SIGSEGV_FAULT_ADDRESS
|
||||
#define SIGSEGV_FAULT_ADDRESS sip->si_ptr
|
||||
#endif
|
||||
#if (defined(arm) || defined(__arm__))
|
||||
#include <asm/ucontext.h> /* use kernel structure, glibc may not be in sync */
|
||||
#if (defined(i386) || defined(__i386__))
|
||||
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[14] /* should use REG_EIP instead */
|
||||
#define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS
|
||||
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
|
||||
#elif (defined(x86_64) || defined(__x86_64__))
|
||||
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[16] /* should use REG_RIP instead */
|
||||
#define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS
|
||||
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
|
||||
#elif (defined(ia64) || defined(__ia64__))
|
||||
#define SIGSEGV_CONTEXT_REGS ((struct sigcontext *)scp)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION (SIGSEGV_CONTEXT_REGS->sc_ip & ~0x3ULL) /* slot number is in bits 0 and 1 */
|
||||
#define SIGSEGV_REGISTER_FILE SIGSEGV_CONTEXT_REGS
|
||||
#define SIGSEGV_SKIP_INSTRUCTION ia64_skip_instruction
|
||||
#elif (defined(powerpc) || defined(__powerpc__))
|
||||
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.regs)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION (SIGSEGV_CONTEXT_REGS->nip)
|
||||
#define SIGSEGV_REGISTER_FILE (unsigned long *)&SIGSEGV_CONTEXT_REGS->nip, (unsigned long *)(SIGSEGV_CONTEXT_REGS->gpr)
|
||||
#define SIGSEGV_SKIP_INSTRUCTION powerpc_skip_instruction
|
||||
#epif (defined(arm) || defined(__arm__))
|
||||
#define SIGSEGV_CONTEXT_REGS (((struct ucontext *)scp)->uc_mcontext)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION (SIGSEGV_CONTEXT_REGS.arm_pc)
|
||||
#define SIGSEGV_REGISTER_FILE (&SIGSEGV_CONTEXT_REGS.arm_r0)
|
||||
#define SIGSEGV_SKIP_INSTRUCTION arm_skip_instruction
|
||||
#endif
|
||||
#if (defined(mips) || defined(__mips__))
|
||||
#include <sys/ucontext.h>
|
||||
#elif (defined(mips) || defined(__mips__))
|
||||
#define SIGSEGV_CONTEXT_REGS (((struct ucontext *)scp)->uc_mcontext)
|
||||
#define SIGSEGV_FAULT_INSTRUCTION (SIGSEGV_CONTEXT_REGS.pc)
|
||||
#define SIGSEGV_REGISTER_FILE &SIGSEGV_CONTEXT_REGS.pc, &SIGSEGV_CONTEXT_REGS.gregs[0]
|
||||
#define SIGSEGV_SKIP_INSTRUCTION mips_skip_instruction
|
||||
#endif
|
||||
#endif
|
||||
#endif // defined(__linux__)
|
||||
#if (defined(__hpux) || defined(__hpux__))
|
||||
#if (defined(__hppa) || defined(__hppa__))
|
||||
#define SIGSEGV_CONTEXT_REGS (&((ucontext_t *)scp)->uc_mcontext)
|
||||
|
Loading…
x
Reference in New Issue
Block a user