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

2012-02-14 Thread Rainer Orth
Ian Lance Taylor i...@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 passes121
# of unexpected failures2

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

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

# of expected passes120
# of unexpected failures3

=== libgo Summary ===

# of expected passes241
# of unexpected failures5
/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

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2012-02-10 Thread Ian Lance Taylor
Rainer Orth r...@cebitec.uni-bielefeld.de writes:

 Ian Lance Taylor i...@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


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

2012-01-27 Thread Rainer Orth
Ian Lance Taylor i...@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

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2012-01-26 Thread Ian Lance Taylor
Rainer Orth r...@cebitec.uni-bielefeld.de writes:

 Ian Lance Taylor i...@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

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 +
+++ 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

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

2012-01-18 Thread Rainer Orth
Ian Lance Taylor i...@google.com writes:

 The patch introduced a couple of other problems:

 * There's a warning during libgo configure:

 * Bootstrap on Solaris  11 is broken:

 * The IRIX libgo build is broken like this:

 Thanks a lot.  All committed.

I hadn't bootstrapped with the fixes before submitting, but doing it now
shows a serious problem on Solaris 8 and 9: libgo now makes uses of many
C99 math functions, some of which are missing, as can be seen with ldd -r.

The situation differs between Solaris/SPARC

symbol not found: log2  (.libs/libgo.so)
symbol not found: trunc (.libs/libgo.so)

and Solaris/x86:

symbol not found: acosl (.libs/libgo.so)
symbol not found: asinl (.libs/libgo.so)
symbol not found: atan2l(.libs/libgo.so)
symbol not found: atanl (.libs/libgo.so)
symbol not found: cosl  (.libs/libgo.so)
symbol not found: expl  (.libs/libgo.so)
symbol not found: expm1l(.libs/libgo.so)
symbol not found: ldexpl(.libs/libgo.so)
symbol not found: log10l(.libs/libgo.so)
symbol not found: log1pl(.libs/libgo.so)
symbol not found: log2l (.libs/libgo.so)
symbol not found: logl  (.libs/libgo.so)
symbol not found: sinl  (.libs/libgo.so)
symbol not found: tanl  (.libs/libgo.so)
symbol not found: trunc (.libs/libgo.so)

The Studio compilers include libsunmath.so.1 which provides those
functions (among others), but neither can one rely on the compilers
being installed now do they end up in a fixed location.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2012-01-18 Thread Rainer Orth
Ian Lance Taylor i...@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

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2012-01-17 Thread Ian Lance Taylor
Uros Bizjak ubiz...@gmail.com writes:

 The library compiles OK, with following small patch:

 --cut here--
 Index: mksysinfo.sh
 ===
 --- mksysinfo.sh(revision 183192)
 +++ mksysinfo.sh(working copy)
 @@ -538,7 +538,7 @@
  # We need TIOCGWINSZ.
  if ! grep '^const TIOCGWINSZ' ${OUT} /dev/null 21; then
if grep '^const _TIOCGWINSZ_val' ${OUT} /dev/null 21; then
 -echo 'const TIOCGWINSZ = TIOCGWINSZ_val'  ${OUT}
 +echo 'const TIOCGWINSZ = _TIOCGWINSZ_val'  ${OUT}
fi
  fi

 --cut here--

Whoops.  Thanks.  Committed.

Ian


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

2012-01-17 Thread Ian Lance Taylor
Rainer Orth r...@cebitec.uni-bielefeld.de writes:

 Ian Lance Taylor i...@google.com writes:

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

 The patch introduced a couple of other problems:

 * There's a warning during libgo configure:

 * Bootstrap on Solaris  11 is broken:

 * The IRIX libgo build is broken like this:

Thanks a lot.  All committed.

Ian


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

2012-01-16 Thread Rainer Orth
Ian Lance Taylor i...@google.com writes:

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

The patch introduced a couple of other problems:

* There's a warning during libgo configure:

checking for --enable-version-specific-runtime-libs... no
/vol/gcc/src/hg/trunk/solaris/libgo/configure[13514]: test: argument expected
checking whether -fsplit-stack is supported... no

  Fixed as follows:

diff --git a/libgo/configure.ac b/libgo/configure.ac
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -126,6 +126,7 @@ is_darwin=no
 is_freebsd=no
 is_irix=no
 is_linux=no
+is_netbsd=no
 is_rtems=no
 is_solaris=no
 GOOS=unknown

* Bootstrap on Solaris  11 is broken:

/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:73:2: error: implicit 
declaration of function 'madvise' [-Werror=implicit-function-declaration]

  The madvise declaration in sys/mman.h is only visible if
  !(_XOPEN_SOURCE  420).  Since _XOPEN_SOURCE is necessary for other
  compilations, I've #undef'ed the symbol at the beginning of this
  particular file:

diff --git a/libgo/runtime/mem.c b/libgo/runtime/mem.c
--- a/libgo/runtime/mem.c
+++ b/libgo/runtime/mem.c
@@ -1,3 +1,7 @@
+/* Defining _XOPEN_SOURCE hides the declaration of madvise() on Solaris 
+   11 and the MADV_DONTNEED definition on IRIX 6.5.  */
+#undef _XOPEN_SOURCE
+
 #include errno.h
 #include unistd.h
 
  As the comment states, IRIX has a similar problem, but that could be
  fixed in a different way.

* The IRIX libgo build is broken like this:

/vol/gcc/src/hg/trunk/local/libgo/runtime/go-map-delete.c: In function 
'__go_map_delete':
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-map-delete.c:38:11: error: 
assignment from incompatible pointer type [-Werror]

/vol/gcc/src/hg/trunk/local/libgo/runtime/go-map-index.c:36:10: error: 
assignment from incompatible pointer type [-Werror]

  On IRIX, size_t and uintptr_t differ, so I'm changing the prototypes
  above to match what's in go-type.h.

/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:70:25: error: unused parameter 
'v' [-Werror=unused-parameter]
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:70:36: error: unused parameter 
'n' [-Werror=unused-parameter]

  As mentioned above, MADV_DONTNEED may be unavailable, so the args need
  to be marked unused to avoid the warning.

diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c
--- a/libgo/runtime/go-map-delete.c
+++ b/libgo/runtime/go-map-delete.c
@@ -20,7 +20,7 @@ __go_map_delete (struct __go_map *map, c
   const struct __go_map_descriptor *descriptor;
   const struct __go_type_descriptor *key_descriptor;
   uintptr_t key_offset;
-  _Bool (*equalfn) (const void*, const void*, size_t);
+  _Bool (*equalfn) (const void*, const void*, uintptr_t);
   size_t key_hash;
   size_t key_size;
   size_t bucket_index;
diff --git a/libgo/runtime/go-map-index.c b/libgo/runtime/go-map-index.c
--- a/libgo/runtime/go-map-index.c
+++ b/libgo/runtime/go-map-index.c
@@ -21,7 +21,7 @@ __go_map_rehash (struct __go_map *map)
   const struct __go_type_descriptor *key_descriptor;
   uintptr_t key_offset;
   size_t key_size;
-  size_t (*hashfn) (const void *, size_t);
+  uintptr_t (*hashfn) (const void *, uintptr_t);
   uintptr_t old_bucket_count;
   void **old_buckets;
   uintptr_t new_bucket_count;
@@ -80,7 +80,7 @@ __go_map_index (struct __go_map *map, co
   const struct __go_map_descriptor *descriptor;
   const struct __go_type_descriptor *key_descriptor;
   uintptr_t key_offset;
-  _Bool (*equalfn) (const void*, const void*, size_t);
+  _Bool (*equalfn) (const void*, const void*, uintptr_t);
   size_t key_hash;
   size_t key_size;
   size_t bucket_index;
diff --git a/libgo/runtime/mem.c b/libgo/runtime/mem.c
--- a/libgo/runtime/mem.c
+++ b/libgo/runtime/mem.c
@@ -71,7 +71,7 @@ runtime_SysAlloc(uintptr n)
 }
 
 void
-runtime_SysUnused(void *v, uintptr n)
+runtime_SysUnused(void *v __attribute__ ((unused)), uintptr n __attribute__ 
((unused)))
 {
 #ifdef MADV_DONTNEED
runtime_madvise(v, n, MADV_DONTNEED);

With those changes, I was able to get libgo to build again on IRIX 6.5
and Solaris 10.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2012-01-15 Thread Uros Bizjak
On Sat, Jan 14, 2012 at 12:18 AM, Ian Lance Taylor i...@google.com wrote:

 This is the same problem with -fdump-go-spec we discussed a couple of
 months ago [1]. In short, alpha linux doesn't just include
 asm-generic/ioctls.h with hardcoded numbers in asm/ioctls.h, but
 builds ioctl arguments as shown in [1]. Probably, this is the right
 way ...

 Oh yeah.

 I think I've worked out a way to handle this kind of thing.  With luck
 this patch will fix the problem.  Bootstrapped on
 x86_64-unknown-linux-gnu, although that doesn't really test it properly.
 Committed to mainline.  Please let me know if this helps.

The library compiles OK, with following small patch:

--cut here--
Index: mksysinfo.sh
===
--- mksysinfo.sh(revision 183192)
+++ mksysinfo.sh(working copy)
@@ -538,7 +538,7 @@
 # We need TIOCGWINSZ.
 if ! grep '^const TIOCGWINSZ' ${OUT} /dev/null 21; then
   if grep '^const _TIOCGWINSZ_val' ${OUT} /dev/null 21; then
-echo 'const TIOCGWINSZ = TIOCGWINSZ_val'  ${OUT}
+echo 'const TIOCGWINSZ = _TIOCGWINSZ_val'  ${OUT}
   fi
 fi

--cut here--

Thanks,
Uros.


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

2012-01-13 Thread Uros Bizjak
Hello!

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

After this commit, compile on alphaev68-linux-gnu dies with:

libtool: compile:  /space/uros/gcc-build-go/./gcc/gccgo
-B/space/uros/gcc-build-go/./gcc/
-B/usr/local/alphaev68-unknown-linux-gnu/bin/
-B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
/usr/local/alphaev68-unknown-linux-gnu/include -isystem
/usr/local/alphaev68-unknown-linux-gnu/sys-include -O2 -g -mieee -I .
-c -fgo-prefix=libgo_exp
../../../gcc-svn/trunk/libgo/go/exp/terminal/terminal.go
../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go  -fPIC -o
exp/.libs/terminal.o
../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go:69:23: error:
reference to undefined identifier ‘syscall.TIOCGWINSZ’
make[4]: *** [exp/terminal.lo] Error 1
make[4]: *** Waiting for unfinished jobs

Uros.


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

2012-01-13 Thread Ian Lance Taylor
Uros Bizjak ubiz...@gmail.com writes:

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

 After this commit, compile on alphaev68-linux-gnu dies with:

 libtool: compile:  /space/uros/gcc-build-go/./gcc/gccgo
 -B/space/uros/gcc-build-go/./gcc/
 -B/usr/local/alphaev68-unknown-linux-gnu/bin/
 -B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
 /usr/local/alphaev68-unknown-linux-gnu/include -isystem
 /usr/local/alphaev68-unknown-linux-gnu/sys-include -O2 -g -mieee -I .
 -c -fgo-prefix=libgo_exp
 ../../../gcc-svn/trunk/libgo/go/exp/terminal/terminal.go
 ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go  -fPIC -o
 exp/.libs/terminal.o
 ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go:69:23: error:
 reference to undefined identifier ‘syscall.TIOCGWINSZ’
 make[4]: *** [exp/terminal.lo] Error 1
 make[4]: *** Waiting for unfinished jobs

Thanks for the report, but this is surprising.  Doesn't Alpha GNU/Linux
define TIOCGWINSZ in /usr/include/asm-generic/ioctls.h?  And isn't that
file #include'd, indirectly, by sys/ioctl.h?

If not, does Alpha GNU/Linux define TIOCGWINSZ at all, and how does it
define it?  I thought TIOCGWINSZ was common, and I'm particularly
surprised to not find it on a GNU/Linux system.

Ian


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

2012-01-13 Thread Rainer Orth
Ian Lance Taylor i...@google.com writes:

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

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'

Rainer  

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


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

2012-01-13 Thread Uros Bizjak
On Fri, Jan 13, 2012 at 7:00 PM, Ian Lance Taylor i...@google.com wrote:
 Uros Bizjak ubiz...@gmail.com writes:

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

 After this commit, compile on alphaev68-linux-gnu dies with:

 libtool: compile:  /space/uros/gcc-build-go/./gcc/gccgo
 -B/space/uros/gcc-build-go/./gcc/
 -B/usr/local/alphaev68-unknown-linux-gnu/bin/
 -B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
 /usr/local/alphaev68-unknown-linux-gnu/include -isystem
 /usr/local/alphaev68-unknown-linux-gnu/sys-include -O2 -g -mieee -I .
 -c -fgo-prefix=libgo_exp
 ../../../gcc-svn/trunk/libgo/go/exp/terminal/terminal.go
 ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go  -fPIC -o
 exp/.libs/terminal.o
 ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go:69:23: error:
 reference to undefined identifier ‘syscall.TIOCGWINSZ’
 make[4]: *** [exp/terminal.lo] Error 1
 make[4]: *** Waiting for unfinished jobs

 Thanks for the report, but this is surprising.  Doesn't Alpha GNU/Linux
 define TIOCGWINSZ in /usr/include/asm-generic/ioctls.h?  And isn't that
 file #include'd, indirectly, by sys/ioctl.h?

 If not, does Alpha GNU/Linux define TIOCGWINSZ at all, and how does it
 define it?  I thought TIOCGWINSZ was common, and I'm particularly
 surprised to not find it on a GNU/Linux system.

This is the same problem with -fdump-go-spec we discussed a couple of
months ago [1]. In short, alpha linux doesn't just include
asm-generic/ioctls.h with hardcoded numbers in asm/ioctls.h, but
builds ioctl arguments as shown in [1]. Probably, this is the right
way ...

[1] http://gcc.gnu.org/ml/gcc-patches/2011-11/msg00117.html

Uros.


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

2012-01-13 Thread Ian Lance Taylor
Rainer Orth r...@cebitec.uni-bielefeld.de writes:

 Ian Lance Taylor i...@google.com writes:

 I have committed a patch to libgo to update it to the weekly.2011-12-22
 release.  As usual I am not including all the changes here, only the
 ones to files which are specific to gccgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

 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.

Ian

diff -r 5623a1911326 libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh	Thu Jan 12 21:00:14 2012 -0800
+++ b/libgo/mksysinfo.sh	Fri Jan 13 15:01:55 2012 -0800
@@ -193,10 +193,13 @@
 # epoll constants.
 grep '^const _EPOLL' gen-sysinfo.go |
   sed -e 's/^\(const \)_\(EPOLL[^= ]*\)\(.*\)$/\1\2 = _\2/'  ${OUT}
-# Make sure EPOLLRDHUP is defined.
+# Make sure EPOLLRDHUP and EPOLL_CLOEXEC are defined.
 if ! grep '^const EPOLLRDHUP' ${OUT} /dev/null 21; then
   echo const EPOLLRDHUP = 0x2000  ${OUT}
 fi
+if ! grep '^const EPOLL_CLOEXEC' ${OUT} /dev/null 21; then
+  echo const EPOLL_CLOEXEC = 0200  ${OUT}
+fi
 
 # Ptrace constants.
 grep '^const _PTRACE' gen-sysinfo.go |


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

2012-01-13 Thread Ian Lance Taylor
Uros Bizjak ubiz...@gmail.com writes:

 On Fri, Jan 13, 2012 at 7:00 PM, Ian Lance Taylor i...@google.com wrote:

 Thanks for the report, but this is surprising.  Doesn't Alpha GNU/Linux
 define TIOCGWINSZ in /usr/include/asm-generic/ioctls.h?  And isn't that
 file #include'd, indirectly, by sys/ioctl.h?

 If not, does Alpha GNU/Linux define TIOCGWINSZ at all, and how does it
 define it?  I thought TIOCGWINSZ was common, and I'm particularly
 surprised to not find it on a GNU/Linux system.

 This is the same problem with -fdump-go-spec we discussed a couple of
 months ago [1]. In short, alpha linux doesn't just include
 asm-generic/ioctls.h with hardcoded numbers in asm/ioctls.h, but
 builds ioctl arguments as shown in [1]. Probably, this is the right
 way ...

Oh yeah.

I think I've worked out a way to handle this kind of thing.  With luck
this patch will fix the problem.  Bootstrapped on
x86_64-unknown-linux-gnu, although that doesn't really test it properly.
Committed to mainline.  Please let me know if this helps.

Thanks for reporting the problem.

Ian

diff -r ade619795842 libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh	Fri Jan 13 15:02:22 2012 -0800
+++ b/libgo/mksysinfo.sh	Fri Jan 13 15:15:32 2012 -0800
@@ -89,6 +89,15 @@
 #if defined(HAVE_NET_IF_H)
 #include net/if.h
 #endif
+
+/* Constants that may only be defined as expressions on some systems,
+   expressions too complex for -fdump-go-spec to handle.  These are
+   handled specially below.  */
+enum {
+#ifdef TIOCGWINSZ
+  TIOCGWINSZ_val = TIOCGWINSZ,
+#endif
+};
 EOF
 
 ${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c
@@ -524,7 +533,14 @@
 
 # The ioctl flags for the controlling TTY.
 grep '^const _TIOC' gen-sysinfo.go | \
+grep -v '_val =' | \
 sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/'  ${OUT}
+# We need TIOCGWINSZ.
+if ! grep '^const TIOCGWINSZ' ${OUT} /dev/null 21; then
+  if grep '^const _TIOCGWINSZ_val' ${OUT} /dev/null 21; then
+echo 'const TIOCGWINSZ = TIOCGWINSZ_val'  ${OUT}
+  fi
+fi
 
 # The ioctl flags for terminal control
 grep '^const _TC[GS]ET' gen-sysinfo.go | \


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

2012-01-12 Thread Ian Lance Taylor
I have committed a patch to libgo to update it to the weekly.2011-12-22
release.  As usual I am not including all the changes here, only the
ones to files which are specific to gccgo.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 27d9b39a0e27 libgo/MERGE
--- a/libgo/MERGE	Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/MERGE	Thu Jan 12 20:57:40 2012 -0800
@@ -1,4 +1,4 @@
-82fdc445f2ff
+4a8268927758
 
 The first line of this file holds the Mercurial revision number of the
 last merge done from the master library sources.
diff -r 27d9b39a0e27 libgo/Makefile.am
--- a/libgo/Makefile.am	Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/Makefile.am	Thu Jan 12 20:57:40 2012 -0800
@@ -279,8 +279,7 @@
 	image/gif.gox \
 	image/jpeg.gox \
 	image/png.gox \
-	image/tiff.gox \
-	image/ycbcr.gox
+	image/tiff.gox
 
 toolexeclibgoindexdir = $(toolexeclibgodir)/index
 
@@ -586,7 +585,8 @@
 	go/image/format.go \
 	go/image/geom.go \
 	go/image/image.go \
-	go/image/names.go
+	go/image/names.go \
+	go/image/ycbcr.go
 
 go_io_files = \
 	go/io/multi.go \
@@ -654,10 +654,15 @@
 go_net_fd_os_file = go/net/fd_linux.go
 go_net_newpollserver_file = go/net/newpollserver.go
 else # !LIBGO_IS_LINUX  !LIBGO_IS_RTEMS
+if LIBGO_IS_NETBSD
+go_net_fd_os_file = go/net/fd_netbsd.go
+go_net_newpollserver_file = go/net/newpollserver.go
+else # !LIBGO_IS_NETBSD  !LIBGO_IS_LINUX  !LIBGO_IS_RTEMS
 # By default use select with pipes.  Most systems should have
 # something better.
 go_net_fd_os_file = go/net/fd_select.go
 go_net_newpollserver_file = go/net/newpollserver.go
+endif # !LIBGO_IS_NETBSD
 endif # !LIBGO_IS_LINUX
 endif # !LIBGO_IS_RTEMS
 
@@ -688,8 +693,12 @@
 if LIBGO_IS_LINUX
 go_net_interface_file = go/net/interface_linux.go
 else
+if LIBGO_IS_NETBSD
+go_net_interface_file = go/net/interface_netbsd.go
+else
 go_net_interface_file = go/net/interface_stub.go
 endif
+endif
 
 go_net_files = \
 	go/net/cgo_unix.go \
@@ -845,6 +854,7 @@
 	go/strconv/atof.go \
 	go/strconv/atoi.go \
 	go/strconv/decimal.go \
+	go/strconv/extfloat.go \
 	go/strconv/ftoa.go \
 	go/strconv/itoa.go \
 	go/strconv/quote.go
@@ -880,7 +890,8 @@
 go_testing_files = \
 	go/testing/benchmark.go \
 	go/testing/example.go \
-	go/testing/testing.go
+	go/testing/testing.go \
+	go/testing/wrapper.go
 
 go_time_files = \
 	go/time/format.go \
@@ -1197,7 +1208,9 @@
 go_go_doc_files = \
 	go/go/doc/comment.go \
 	go/go/doc/doc.go \
-	go/go/doc/example.go
+	go/go/doc/example.go \
+	go/go/doc/exports.go \
+	go/go/doc/filter.go
 go_go_parser_files = \
 	go/go/parser/interface.go \
 	go/go/parser/parser.go
@@ -1241,7 +1254,8 @@
 	go/image/bmp/reader.go
 
 go_image_color_files = \
-	go/image/color/color.go
+	go/image/color/color.go \
+	go/image/color/ycbcr.go
 
 go_image_draw_files = \
 	go/image/draw/draw.go
@@ -1266,9 +1280,6 @@
 	go/image/tiff/consts.go \
 	go/image/tiff/reader.go
 
-go_image_ycbcr_files = \
-	go/image/ycbcr/ycbcr.go
-
 go_index_suffixarray_files = \
 	go/index/suffixarray/qsufsort.go \
 	go/index/suffixarray/suffixarray.go
@@ -1318,6 +1329,7 @@
 	go/net/http/filetransport.go \
 	go/net/http/fs.go \
 	go/net/http/header.go \
+	go/net/http/jar.go \
 	go/net/http/lex.go \
 	go/net/http/request.go \
 	go/net/http/response.go \
@@ -1761,7 +1773,6 @@
 	image/jpeg.lo \
 	image/png.lo \
 	image/tiff.lo \
-	image/ycbcr.lo \
 	index/suffixarray.lo \
 	io/ioutil.lo \
 	log/syslog.lo \
@@ -3066,16 +3077,6 @@
 	@$(CHECK)
 .PHONY: image/tiff/check
 
-@go_include@ image/ycbcr.lo.dep
-image/ycbcr.lo.dep: $(go_image_ycbcr_files)
-	$(BUILDDEPS)
-image/ycbcr.lo: $(go_image_ycbcr_files)
-	$(BUILDPACKAGE)
-image/ycbcr/check: $(CHECK_DEPS)
-	@$(MKDIR_P) image/ycbcr
-	@$(CHECK)
-.PHONY: image/ycbcr/check
-
 @go_include@ index/suffixarray.lo.dep
 index/suffixarray.lo.dep: $(go_index_suffixarray_files)
 	$(BUILDDEPS)
@@ -3728,8 +3729,6 @@
 	$(BUILDGOX)
 image/tiff.gox: image/tiff.lo
 	$(BUILDGOX)
-image/ycbcr.gox: image/ycbcr.lo
-	$(BUILDGOX)
 
 index/suffixarray.gox: index/suffixarray.lo
 	$(BUILDGOX)
@@ -3938,11 +3937,11 @@
 	hash/crc32/check \
 	hash/crc64/check \
 	hash/fnv/check \
+	image/color/check \
 	image/draw/check \
 	image/jpeg/check \
 	image/png/check \
 	image/tiff/check \
-	image/ycbcr/check \
 	index/suffixarray/check \
 	io/ioutil/check \
 	log/syslog/check \
diff -r 27d9b39a0e27 libgo/configure.ac
--- a/libgo/configure.ac	Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/configure.ac	Thu Jan 12 20:57:40 2012 -0800
@@ -134,6 +134,7 @@
   *-*-freebsd*)  is_freebsd=yes; GOOS=freebsd ;;
   *-*-irix6*)is_irix=yes;GOOS=irix ;;
   *-*-linux*)is_linux=yes;   GOOS=linux ;;
+  *-*-netbsd*)	 is_netbsd=yes;  GOOS=netbsd ;;
   *-*-rtems*)is_rtems=yes;   GOOS=rtems ;;
   *-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
 esac
@@ -141,6 +142,7 @@
 AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
 AM_CONDITIONAL(LIBGO_IS_IRIX, test $is_irix = yes)
 AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)