2011/8/22 Ian Lance Taylor <iant@xxxxxxxxxx>: > Maciej Bliziński <maciej@xxxxxxxxxxx> writes: > >> type Iovec_len_t int32 >> type Iovec struct { Base _caddr_t; Len Iovec_len_t; } >> type Msghdr_controllen_t >> type Msghdr struct { Name *byte; Namelen uint32; Iov *Iovec; Iovlen >> int32; msg_accrights _caddr_t; msg_accrightslen int32; } >> >> The first observation is that on sparc there's nothing after the >> Msghdr_controllen_t. Does anyone have an advice where to look to make >> it build? > > Which version of gcc are you building? Best to stick with mainline for > this. I started with the gcc-4.6.1 tarball. > If you are using mainline, then what does the definition of "struct > msghdr" look like in <sys/socket.h> (it may be defined in some header > file #included by <sys/socket.h>)? maciej@unstable9s :~/src/opencsw/pkg/gcc4/branches/gccgo > ggrep -A14 "struct msghdr {" /usr/include/sys/socket.h struct msghdr { void *msg_name; /* optional address */ socklen_t msg_namelen; /* size of address */ struct iovec *msg_iov; /* scatter/gather array */ int msg_iovlen; /* # elements in msg_iov */ #if defined(_XPG4_2) || defined(_KERNEL) void *msg_control; /* ancillary data */ socklen_t msg_controllen; /* ancillary data buffer len */ int msg_flags; /* flags on received message */ #else caddr_t msg_accrights; /* access rights sent/received */ int msg_accrightslen; #endif /* defined(_XPG4_2) || defined(_KERNEL) */ }; > Also, look for "type _msghdr" in gen-sysinfo.go. What does the type > look like? Splitting into multi-line: type _msghdr struct { msg_name *byte; msg_namelen uint32; msg_iov *_iovec; msg_iovlen int32; msg_accrights _caddr_t; msg_accrightslen int32; } > The definition of Msghdr_controllen_t is generated by the shell script > mksysinfo.sh. Something is going wrong there. Looking at mksysinfo.sh, the first thing I noticed is the use of the "if ! ...; then ..; fi" construct together with "#!/bin/sh". On Solaris, /bin/sh does not support the "if ! ..." syntax. You need to say "if ...; then nothing; else ...; fi". #!/bin/sh # Invalid if ! false; then echo "Test 1" fi # Valid if false; then echo -n # nothing else echo "Test 2" fi The other option is to use a different shell. What's the exact problem with Msghdr_controllen_t I don't know yet, I will look at the shell script more closely and reply again. Maciej