Hi Ian, > This libgo patch by Nikhil Benesch imports additional code from > upstream for handing system calls on BSD systems. This makes the > syscall package on NetBSD complete enough to compile the standard > library. Boostrapped and ran Go testsuite on x86_64-pc-linux-gnu. > Committed to mainline.
this patch broke Solaris bootstrap: /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_solaris_largefile.go:12:1: error: redefinition of 'ReadDirent' 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { | ^ /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_bsd.go:27:1: note: previous definition of 'ReadDirent' was here 27 | func ReadDirent(fd int, buf []byte) (n int, err error) { | ^ libcalls.go:2320:1: error: redefinition of 'raw_ptrace' 2320 | func raw_ptrace(request int, pid int, addr uintptr, data uintptr) (err Errno) { | ^ libcalls.go:383:1: note: previous definition of 'raw_ptrace' was here 383 | func raw_ptrace(request int, pid int, addr uintptr, data uintptr) (err Errno) { | ^ /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_bsd.go:33:16: error: reference to undefined name 'Getdirentries' 33 | return Getdirentries(fd, buf, base) | ^ /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_bsd.go:33:9: error: not enough arguments to return 33 | return Getdirentries(fd, buf, base) | ^ /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_bsd.go:69:21: error: reference to undefined name 'nametomib' 69 | mib, err := nametomib(name) | ^ /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_bsd.go:98:21: error: reference to undefined name 'nametomib' 98 | mib, err := nametomib(name) | ^ libcalls.go:2321:85: error: argument 4 has incompatible type 2321 | _r := c_ptrace(_C_int(request), Pid_t(pid), (*byte)(unsafe.Pointer(addr)), (*byte)(unsafe.Pointer(data))) | ^ make[4]: *** [Makefile:2912: syscall.lo] Error 1 Of the functions used there, ptrace (32-bit only) is already handled and sysctl, paccept and flock don't exist on Solaris. Only pipe2 does exist, but it's only in Solaris 11.4 and Illumos, not Solaris 11.3, so better left off for now. Fixed by removing the solaris build tag. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University
diff --git a/libgo/go/syscall/libcall_bsd.go b/libgo/go/syscall/libcall_bsd.go --- a/libgo/go/syscall/libcall_bsd.go +++ b/libgo/go/syscall/libcall_bsd.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd openbsd solaris +// +build darwin dragonfly freebsd netbsd openbsd // BSD library calls.