$NetBSD: patch-src_zm_signal_cpp,v 1.2 2020/08/25 16:42:21 gdt Exp $ Don't assume machine-dependent IP register details are available for any platform except Linux. Only Linux is sure to have this style of mcontext_t. Resolves build on systems that have ucontext_t but an mcontext_t that doesn't look like Linux. --- src/zm_signal.cpp.orig 2016-02-03 18:40:30.000000000 +0000 +++ src/zm_signal.cpp @@ -69,13 +69,17 @@ RETSIGTYPE zm_die_handler(int signal) #ifdef __FreeBSD_kernel__ ip = (void *)(uc->uc_mcontext.mc_rip); #else + #if defined(__linux__) ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]); + #endif #endif #else #ifdef __FreeBSD_kernel__ ip = (void *)(uc->uc_mcontext.mc_eip); #else + #if defined(__linux__) ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]); + #endif #endif #endif // defined(__x86_64__)