There are more issues on Solaris, though: /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_bsd.go:13:25: error: expected package /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_bsd.go:13:30: error: expected ';' or newline after top level declaration /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_bsd.go:15:1: error: expected declaration
There's no C package in gcc libgo, so I'm removing that. But even with that fix, cgo_bsd.go doesn't compile on Solaris: /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_bsd.go:14:17: error: reference to undefined identifier 'syscall.AI_MASK' It seems that cgo_linux.go should be the default, which is what the patch below does. Btw., dealing with deeply nested automake conditionals is a total mess. What about a patch to move the logic to select the various variants to configure.ac and substitute the result into Makefile? /vol/gcc/src/hg/trunk/local/libgo/go/net/sock_bsd.go:21:55: error: reference to undefined identifier 'syscall.SO_REUSEPORT' SO_REUSEPORT doesn't exist on Solaris. Again, sock_linux.go seems to be generic and should become the default (losing the name, perhaps use cgo_posix instead?). IRIX has the same issue (and more, to be reported separately). This patch (and the mksysinfo.go hack for _FILE/___FILE) allowed me to build libgo.so on Solaris 10/x86. Rainer 2011-05-20 Rainer Orth <r...@cebitec.uni-bielefeld.de> libgo: * Makefile.am (go_net_sock_file): Use go/net/cgo_linux.go if LIBGO_IS_IRIX or LIBGO_IS_SOLARIS. (go_net_sock_file): Use go/net/sock_linux.go if LIBGO_IS_IRIX or LIBGO_IS_SOLARIS. * Makefile.in: Regenerate. * go/net/cgo_bsd.go: Don't refer to C.int. diff --git a/libgo/Makefile.am b/libgo/Makefile.am --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -669,9 +669,19 @@ if LIBGO_IS_LINUX go_net_cgo_file = go/net/cgo_linux.go go_net_sock_file = go/net/sock_linux.go else +if LIBGO_IS_IRIX +go_net_cgo_file = go/net/cgo_linux.go +go_net_sock_file = go/net/sock_linux.go +else +if LIBGO_IS_SOLARIS +go_net_cgo_file = go/net/cgo_linux.go +go_net_sock_file = go/net/sock_linux.go +else go_net_cgo_file = go/net/cgo_bsd.go go_net_sock_file = go/net/sock_bsd.go endif +endif +endif go_net_files = \ go/net/cgo_unix.go \ diff --git a/libgo/go/net/cgo_bsd.go b/libgo/go/net/cgo_bsd.go --- a/libgo/go/net/cgo_bsd.go +++ b/libgo/go/net/cgo_bsd.go @@ -10,6 +10,6 @@ package net import "syscall" -func cgoAddrInfoMask() C.int { +func cgoAddrInfoMask() int { return syscall.AI_MASK } -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University