This libgo patch by Nikhil Benesch sets the signal PC field on NetBSD.
The NetBSD libc provides an architecture-independent macro that can
extract the PC from a ucontext struct.  Bootstrapped and ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
7e5aeda340d71a84fbd15504e848a949b2a00d5a
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 80e702fc3f5..2c7a9bde825 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-5e76d81ec120e05a59e6c7d173ddf8a3de466bd0
+6cb7b9e924d84125f21f4a2a96aa0d59466056fe
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index b429fdb2403..d30d1603adc 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -229,6 +229,8 @@ getSiginfo(siginfo_t *info, void *context 
__attribute__((unused)))
        ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
 #elif defined(__aarch64__) && defined(__linux__)
        ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.pc;
+#elif defined(__NetBSD__)
+       ret.sigpc = _UC_MACHINE_PC(((ucontext_t*)(context)));
 #endif
 
        if (ret.sigpc == 0) {

Reply via email to