This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: Update to Go 1.5 release
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Ian Lance Taylor <iant at golang dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "gofrontend-dev\ at googlegroups dot com" <gofrontend-dev at googlegroups dot com>
- Date: Fri, 06 Nov 2015 14:01:18 +0100
- Subject: Re: libgo patch committed: Update to Go 1.5 release
- Authentication-results: sourceware.org; auth=none
- References: <CAOyqgcWGmHROKJwtefzkRbYsF8ogrZG=_RoHXFQ4DGeMGZ5mow at mail dot gmail dot com>
Ian Lance Taylor <iant@golang.org> writes:
> I have committed a patch to libgo to update it to the Go 1.5 release.
>
> As usual for libgo updates, the actual patch is too large to attach to
> this e-mail message. I've attached the changes to the gccgo-specific
> files.
>
> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed
> to mainline.
>
> This may cause trouble on non-GNU/Linux operating systems. Please let
> me know about any problems you encounter.
It does indeed (first tried on i386-pc-solaris2.10):
*
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-varargs.c: In function '__go_ioctl':
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-varargs.c:63:10: error: implicit declaration of function 'ioctl' [-Werror=implicit-function-declaration]
return ioctl (d, request, arg);
^
Needs <unistd.h>, the following patch works:
diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c
--- a/libgo/runtime/go-varargs.c
+++ b/libgo/runtime/go-varargs.c
@@ -11,6 +11,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>
+#include <unistd.h>
/* The syscall package calls C functions. The Go compiler can not
represent a C varargs functions. On some systems it's important
*
/vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_bsd.go:107:7: error: incompatible types in assignment (cannot use type int as type Pid_t)
r1 = raw_getpid()
^
I can cast to Pid_t and this works. The underlying error to me seems
that raw_getpid the in the generated libcalls.go is wrong, casting
c_getpid return value to int while pid_t can be long.
*
/vol/gcc/src/hg/trunk/local/libgo/go/net/hook_cloexec.go:13:70: error: reference to undefined identifier 'syscall.Accept4'
accept4Func func(int, int) (int, syscall.Sockaddr, error) = syscall.Accept4
^
No accept4 on Solaris (and certainly other systems, thence configure
test), but used unconditionally.
*
/vol/gcc/src/hg/trunk/local/libgo/go/net/sendfile_solaris.go:78:22: error: reference to undefined identifier 'syscall.Sendfile'
n, err1 := syscall.Sendfile(dst, src, &pos1, n)
^
Only in go/syscall/libcall_linux.go!?
*
/vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_solaris.go:34:103: error: reference to undefined identifier 'syscall.TCP_KEEPALIVE_THRESHOLD'
return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE_THRESHOLD, msecs))
^
Not in Solaris 10, only Solaris 11 and 12 have it.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University