https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106813 --- gcc-12.1.0/libgo/runtime/go-signal.c +++ gcc-12.1.0/libgo/runtime/go-signal.c @@ -262,6 +262,12 @@ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.pc; #elif defined(__NetBSD__) ret.sigpc = _UC_MACHINE_PC(((ucontext_t*)(context))); +#elif defined(__x86_64__) && defined(__sun__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[REG_RIP]; +#elif defined(__i386__) && defined(__sun__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[REG_RIP]; +#elif defined(__sparc__) && defined(__sun__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[REG_PC]; #endif if (ret.sigpc == 0) {