Backport a patch just committed to gc tip. There is a bug report on the golang-dev mailing list (https://groups.google.com/d/msg/golang-dev/sDg-t1_DPw0/-AJmLxgPBQAJ) in which waitid running on MIPS returns EFAULT, and this patch may fix the problem. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline and GCC 7 branch.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 249595) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -f107cc8bced1939b0083231fc1ea24669ca4832c +c49ba1ca392b3c23a4b3934e0a95a908b1dc2f1d The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/os/wait_waitid.go =================================================================== --- libgo/go/os/wait_waitid.go (revision 249205) +++ libgo/go/os/wait_waitid.go (working copy) @@ -23,7 +23,7 @@ func (p *Process) blockUntilWaitable() ( // On Darwin, it requires greater than or equal to 64 bytes // for darwin/{386,arm} and 104 bytes for darwin/amd64. // We don't care about the values it returns. - var siginfo [128]byte + var siginfo [16]uint64 psig := &siginfo[0] _, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0) runtime.KeepAlive(p)