diff mbox

libgo patch committed: Update to Go 1.4

Message ID yddwq4oqa5e.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Jan. 15, 2015, 4:30 p.m. UTC
Ian Lance Taylor <iant@golang.org> writes:

> I've committed a patch to libgo to update it to the Go 1.4 release,
> except for the runtime package.  Much of the runtime package was
> rewritten in Go, and it does not really affect users of the library,
> so I've postponed that complex merge.  All the other packages are
> updated.  A few minor compiler changes were required, as well as a few
> changes to the runtime packages required for other changes.  The
> testsuite script was changed to add support for the new TestMain
> function, which is used by one or two of the standard packages.
>
> As usual with libgo updates the entire patch is too large to attach
> here.  I've attached the changes to configuration/build files and the
> runtime package.
>
> Note that the type descriptor format has changed very very slightly to
> include an additional flag.  This means that all existing Go files
> must be recompiled in order to work with this updated libgo.  I will
> bump the libgo version number shortly.
>
> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
> Committed to mainline.

This (and perhaps the previous gotools) patch broke Solaris bootstrap:

/vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:23:73: error: reference to undefined identifier 'syscall.TCP_KEEPINTVL'
  if err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, secs); err != nil {
/vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:26:103: error: reference to undefined identifier 'syscall.TCP_KEEPIDLE'
  return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPIDLE, secs))
make[4]: *** [net.lo] Error 1

The following patch fixes this:
Apart from that, bootstrap fails in gotools: due to the use of
-static-libgo, all commands there fail to link since the socket
functions are missing.  It seems like $LIBS from libgo needs to be added
somewhere, but I'm unsure how best to handle this.  To make any progress
at all, I've just manually added -lsocket -lnsl to gotools/Makefile
(AM_LDFLAGS).

	Rainer

Comments

Ian Lance Taylor Jan. 15, 2015, 8:47 p.m. UTC | #1
On Thu, Jan 15, 2015 at 8:30 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
>
> This (and perhaps the previous gotools) patch broke Solaris bootstrap:
>
> /vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:23:73: error: reference to undefined identifier 'syscall.TCP_KEEPINTVL'
>   if err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, secs); err != nil {
> /vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:26:103: error: reference to undefined identifier 'syscall.TCP_KEEPIDLE'
>   return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPIDLE, secs))
> make[4]: *** [net.lo] Error 1
>
> The following patch fixes this:

That's interesting--would you mind looking into this just a bit more?
What version of Solaris was this?  In the gc version of the library,
those symbols are defined for Solaris.  TCP_KEEPINTVL is 0x24 and
TCP_KEEPIDLE is 0x22.  I just want to make sure that they are really
not defined on your system, and the problem is not that mksysinfo is
somehow failing to handle the definition.

Ian
Rainer Orth Jan. 16, 2015, 9:06 a.m. UTC | #2
Ian Lance Taylor <iant@golang.org> writes:

> On Thu, Jan 15, 2015 at 8:30 AM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>>
>> This (and perhaps the previous gotools) patch broke Solaris bootstrap:
>>
>> /vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:23:73: error:
>> reference to undefined identifier 'syscall.TCP_KEEPINTVL'
>>   if err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP,
>> syscall.TCP_KEEPINTVL, secs); err != nil {
>> /vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:26:103:
>> error: reference to undefined identifier 'syscall.TCP_KEEPIDLE'
>>   return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd,
>> syscall.IPPROTO_TCP, syscall.TCP_KEEPIDLE, secs))
>> make[4]: *** [net.lo] Error 1
>>
>> The following patch fixes this:
>
> That's interesting--would you mind looking into this just a bit more?
> What version of Solaris was this?  In the gc version of the library,
> those symbols are defined for Solaris.  TCP_KEEPINTVL is 0x24 and
> TCP_KEEPIDLE is 0x22.  I just want to make sure that they are really
> not defined on your system, and the problem is not that mksysinfo is
> somehow failing to handle the definition.

I'd checked this before and did some more archaeology now: on Solaris
11.2, <netinet/tcp.h> has

#define	TCP_INFO			0x22	/* connection information */

and 0x24 isn't defined yet.

OTOH, on Illumos (one of the OpenSolaris derivatives) I find

#define TCP_KEEPIDLE                    0x22
#define TCP_KEEPINTVL                   0x24

	Rainer
diff mbox

Patch

diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -340,7 +340,7 @@  grep '^const _SHUT_' gen-sysinfo.go |
   sed -e 's/^\(const \)_\(SHUT[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
 
 # The net package requires some const definitions.
-for m in IP_PKTINFO IPV6_V6ONLY IPPROTO_IPV6 IPV6_JOIN_GROUP IPV6_LEAVE_GROUP IPV6_TCLASS SO_REUSEPORT; do
+for m in IP_PKTINFO IPV6_V6ONLY IPPROTO_IPV6 IPV6_JOIN_GROUP IPV6_LEAVE_GROUP IPV6_TCLASS SO_REUSEPORT TCP_KEEPINTVL TCP_KEEPIDLE; do
   if ! grep "^const $m " ${OUT} >/dev/null 2>&1; then
     echo "const $m = 0" >> ${OUT}
   fi