$OpenBSD: patch-src_runtime_asm_mips64x_s,v 1.2 2021/08/27 18:33:27 jsing Exp $

Index: src/runtime/asm_mips64x.s
--- src/runtime/asm_mips64x.s.orig
+++ src/runtime/asm_mips64x.s
@@ -443,6 +443,8 @@ TEXT ·asmcgocall(SB),NOSPLIT,$0-20
 	// We get called to create new OS threads too, and those
 	// come in on the m->g0 stack already.
 	MOVV	g_m(g), R5
+	MOVV	m_gsignal(R5), R6
+	BEQ	R6, g, g0
 	MOVV	m_g0(R5), R6
 	BEQ	R6, g, g0
 
@@ -478,9 +480,12 @@ TEXT ·cgocallback(SB),NOSPLIT,$24-24
 	NO_LOCAL_POINTERS
 
 	// Load m and g from thread-local storage.
+#ifndef GOOS_openbsd
 	MOVB	runtime·iscgo(SB), R1
 	BEQ	R1, nocgo
+#endif
 	JAL	runtime·load_g(SB)
+
 nocgo:
 
 	// If g is nil, Go did not create the current thread.
