diff mbox

libgo patch committed: Update to weekly.2011-12-22

Message ID mcrobtqrz4k.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 26, 2012, 8:24 p.m. UTC
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Ian Lance Taylor <iant@google.com> writes:
>
>>> This also broke bootstrap on x86_64-unknown-linux-gnu (CentOS 5.5):
>>>
>>> /vol/gcc/src/hg/trunk/local/libgo/go/net/fd_linux.go:40:46: error: reference to undefined identifier 'syscall.EPOLL_CLOEXEC'
>>
>> Thanks.  Fixed like so.  Bootstrapped on x86_64-unknown-linux-gnu.
>> Committed to mainline.
>
> Thanks.  Unfortunately, this is not enough: while the build finishes
> now, all tests fail with
>
> /var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./libgo/.libs/libgo.so: undefined reference to `epoll_create1'
> collect2: error: ld returned 1 exit status

Fixed with the appended patch, which also gathers up all the possibly
missing functions that I noticed.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu, which proves little as the system I tested on
has all these functions anyhow.  Committed to mainline.

Thanks for the bug report.

Ian

Comments

Rainer Orth Jan. 27, 2012, 6:15 p.m. UTC | #1
Ian Lance Taylor <iant@google.com> writes:

> Fixed with the appended patch, which also gathers up all the possibly
> missing functions that I noticed.  Bootstrapped and ran Go testsuite on
> x86_64-unknown-linux-gnu, which proves little as the system I tested on
> has all these functions anyhow.  Committed to mainline.

Results are way better now, but still a couple of libgo FAILs:

Running target unix
FAIL: net
FAIL: websocket
FAIL: compress/flate
FAIL: exp/ssh
FAIL: image/jpeg
FAIL: log/syslog
FAIL: net/http
FAIL: net/http/httputil
FAIL: net/rpc
FAIL: os/exec

Most of them are like

Start pollServer: epoll_ctl: Bad file descriptor
panic: runtime error: invalid memory address or nil pointer dereference
FAIL: net

	Rainer
Ian Lance Taylor Feb. 10, 2012, 11:48 p.m. UTC | #2
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Ian Lance Taylor <iant@google.com> writes:
>
>> Fixed with the appended patch, which also gathers up all the possibly
>> missing functions that I noticed.  Bootstrapped and ran Go testsuite on
>> x86_64-unknown-linux-gnu, which proves little as the system I tested on
>> has all these functions anyhow.  Committed to mainline.
>
> Results are way better now, but still a couple of libgo FAILs:
>
> Running target unix
> FAIL: net
> FAIL: websocket
> FAIL: compress/flate
> FAIL: exp/ssh
> FAIL: image/jpeg
> FAIL: log/syslog
> FAIL: net/http
> FAIL: net/http/httputil
> FAIL: net/rpc
> FAIL: os/exec
>
> Most of them are like
>
> Start pollServer: epoll_ctl: Bad file descriptor
> panic: runtime error: invalid memory address or nil pointer dereference
> FAIL: net

That sort of problem should be fixed now, by

http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00110.html

Ian
Rainer Orth Feb. 14, 2012, 1:51 p.m. UTC | #3
Ian Lance Taylor <iant@google.com> writes:

>> Most of them are like
>>
>> Start pollServer: epoll_ctl: Bad file descriptor
>> panic: runtime error: invalid memory address or nil pointer dereference
>> FAIL: net
>
> That sort of problem should be fixed now, by
>
> http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00110.html

Indeed, thanks.  I only see a small number of unrelated FAILs on CentOS
5.6 now:

		=== libgo tests ===


Running target unix
FAIL: compress/flate
FAIL: image/jpeg

		=== libgo Summary for unix ===

# of expected passes		121
# of unexpected failures	2

Running target unix/-m32
FAIL: compress/flate
FAIL: database/sql
FAIL: image/jpeg

		=== libgo Summary for unix/-m32 ===

# of expected passes		120
# of unexpected failures	3

		=== libgo Summary ===

# of expected passes		241
# of unexpected failures	5
/var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/./gcc/gccgo version 4.7.0 20120210 (experimental) [trunk revision 184103] (GCC)

The compress/flate and image/jpeg failures seem to be races creating the
testdata symlink during a highly parallel make check:

ln: creating symbolic link `../testdata/testdata' to `/vol/gcc/src/hg/trunk/local/libgo/go/compress/flate/../testdata': File exists
--- FAIL: flate.TestDeflateInflateString (0.00 seconds)
        ???:1: open ../testdata/e.txt: No such file or directory
        ???:1: open ../testdata/Mark.Twain-Tom.Sawyer.txt: No such file or directory
FAIL
FAIL: compress/flate

--- FAIL: jpeg.TestWriter (0.05 seconds)
        ???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
        ???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
        ???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
        ???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
        ???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
        ???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
FAIL
FAIL: image/jpeg

The 32-bit database/sql failure also occurs when using gld on Solaris:

/vol/gcc/bin/gld-2.22: dynamic variable `libgo_database_sql.driver.Bool' is zero size
/vol/gcc/bin/gld-2.22: dynamic variable `libgo_database_sql.driver.DefaultParameterConverter' is zero size
/vol/gcc/bin/gld-2.22: _gotest_.o(.text+0xba12): unresolvable R_386_32 relocation against symbol `libgo_database_sql.driver.Bool'
/vol/gcc/bin/gld-2.22: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
FAIL: database/sql

	Rainer
diff mbox

Patch

diff -r 9013911dbab2 libgo/Makefile.am
--- a/libgo/Makefile.am	Wed Jan 25 21:42:35 2012 -0800
+++ b/libgo/Makefile.am	Thu Jan 26 12:15:48 2012 -0800
@@ -449,6 +449,7 @@ 
 	runtime/go-now.c \
 	runtime/go-new-map.c \
 	runtime/go-new.c \
+	runtime/go-nosys.c \
 	runtime/go-panic.c \
 	runtime/go-print.c \
 	runtime/go-recover.c \
diff -r 9013911dbab2 libgo/configure.ac
--- a/libgo/configure.ac	Wed Jan 25 21:42:35 2012 -0800
+++ b/libgo/configure.ac	Thu Jan 26 12:15:48 2012 -0800
@@ -33,6 +33,8 @@ 
 
 AM_MAINTAINER_MODE
 
+AC_INCLUDES_DEFAULT
+
 AC_PROG_LD
 AC_PROG_RANLIB
 AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)
@@ -465,6 +467,9 @@ 
 AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
 AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
 
+AC_CHECK_FUNCS(epoll_create1 faccessat fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare)
+AC_CHECK_TYPES([loff_t])
+
 CFLAGS_hold="$CFLAGS"
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 LIBS_hold="$LIBS"
@@ -519,7 +524,7 @@ 
 
 CFLAGS_hold=$CFLAGS
 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
-AC_CHECK_TYPES(off64_t)
+AC_CHECK_TYPES([off64_t])
 CFLAGS=$CFLAGS_hold
 
 dnl Work out the size of the epoll_events struct on GNU/Linux.
diff -r 9013911dbab2 libgo/runtime/go-nosys.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/runtime/go-nosys.c	Thu Jan 26 12:15:48 2012 -0800
@@ -0,0 +1,192 @@ 
+/* go-nosys.c -- functions missing from system.
+
+   Copyright 2012 The Go Authors. All rights reserved.
+   Use of this source code is governed by a BSD-style
+   license that can be found in the LICENSE file.  */
+
+/* This file exists to provide definitions for functions that are
+   missing from libc, according to the configure script.  This permits
+   the Go syscall package to not worry about whether the functions
+   exist or not.  */
+
+#include "config.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#ifndef HAVE_OFF64_T
+typedef signed int off64_t __attribute__ ((mode (DI)));
+#endif
+
+#ifndef HAVE_LOFF_T
+typedef off64_t loff_t;
+#endif
+
+#ifndef HAVE_EPOLL_CREATE1
+int
+epoll_create1 (int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FACCESSAT
+int
+faccessat (int fd __attribute__ ((unused)),
+	   const char *pathname __attribute__ ((unused)),
+	   int mode __attribute__ ((unused)),
+	   int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FCHMODAT
+int
+fchmodat (int dirfd __attribute__ ((unused)),
+	  const char *pathname __attribute__ ((unused)),
+	  mode_t mode __attribute__ ((unused)),
+	  int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FCHOWNAT
+int
+fchownat (int dirfd __attribute__ ((unused)),
+	  const char *pathname __attribute__ ((unused)),
+	  uid_t owner __attribute__ ((unused)),
+	  gid_t group __attribute__ ((unused)),
+	  int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FUTIMESAT
+int
+futimesat (int dirfd __attribute__ ((unused)),
+	   const char *pathname __attribute__ ((unused)),
+	   const struct timeval times[2] __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_INOTIFY_ADD_WATCH
+int
+inotify_add_watch (int fd __attribute__ ((unused)),
+		   const char* pathname __attribute__ ((unused)),
+		   uint32_t mask __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_INOTIFY_INIT
+int
+inotify_init (void)
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_INOTIFY_RM_WATCH
+int
+inotify_rm_watch (int fd __attribute__ ((unused)),
+		  uint32_t wd __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_MKDIRAT
+int
+mkdirat (int dirfd __attribute__ ((unused)),
+	 const char *pathname __attribute__ ((unused)),
+	 mode_t mode __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_MKNODAT
+int
+mknodat (int dirfd __attribute__ ((unused)),
+	 const char *pathname __attribute__ ((unused)),
+	 mode_t mode __attribute__ ((unused)),
+	 dev_t dev __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_OPENAT
+int
+openat (int dirfd __attribute__ ((unused)),
+	const char *pathname __attribute__ ((unused)),
+	int oflag __attribute__ ((unused)),
+	...)
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_RENAMEAT
+int
+renameat (int olddirfd __attribute__ ((unused)),
+	  const char *oldpath __attribute__ ((unused)),
+	  int newdirfd __attribute__ ((unused)),
+	  const char *newpath __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_SPLICE
+int
+splice (int fd __attribute__ ((unused)),
+	loff_t *off_in __attribute__ ((unused)),
+	int fd_out __attribute__ ((unused)),
+	loff_t *off_out __attribute__ ((unused)),
+	size_t len __attribute__ ((unused)),
+	unsigned int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_TEE
+int
+tee (int fd_in __attribute__ ((unused)),
+     int fd_out __attribute__ ((unused)),
+     size_t len __attribute__ ((unused)),
+     unsigned int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_UNLINKAT
+int
+unlinkat (int dirfd __attribute__ ((unused)),
+	  const char *pathname __attribute__ ((unused)),
+	  int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_UNSHARE
+int
+unshare (int flags __attribute__ ((unused)))
+{
+  return ENOSYS;
+}
+#endif