This patch to libgo changes the signal handler for PPC (and PPC64) GNU/Linux to fetch the PC from the signal context. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu and powerpc64le-unknown-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 250433) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -e34cb8dee6c1f215329e0eea79202b48cb83817c +a9f1aeced86691de891fbf2a8c97e848faf1962e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/runtime/go-signal.c =================================================================== --- libgo/runtime/go-signal.c (revision 250406) +++ libgo/runtime/go-signal.c (working copy) @@ -215,6 +215,11 @@ getSiginfo(siginfo_t *info, void *contex ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[REG_EIP]; #endif #endif +#ifdef __PPC__ + #ifdef __linux__ + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip; + #endif +#endif if (ret.sigpc == 0) { // Skip getSiginfo/sighandler/sigtrampgo/sigtramp/handler.