Joel Sherrill <joel.sherr...@gmail.com> writes: > After all of Ian's commits, this is now the error output from a "make -k" > so I think this is > getting close. > > libtool: compile: /home2/joel/build/b-sparc-go/./gcc/gccgo > -B/home2/joel/build/b-sparc-go/./gcc/ > -B/users/joel/test-gcc/install-svn/sparc-rtems4.11/bin/ > -B/users/joel/test-gcc/install-svn/sparc-rtems4.11/lib/ -isystem > /users/joel/test-gcc/install-svn/sparc-rtems4.11/include -isystem > /users/joel/test-gcc/install-svn/sparc-rtems4.11/sys-include -O2 -g -I . -c > -fgo-prefix=libgo_syscall > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/env_unix.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/libcall_support.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/libcall_posix.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/socket.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/str.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/syscall.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/syscall_stubs.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/exec_stubs.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/sleep_rtems.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/errstr_linux.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/libcall_posix_regfile.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/socket_bsd.go > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/libcall_uname.go libcalls.go > sysinfo.go syscall_arch.go -o syscall/syscall.o > sysinfo.go:2319:16: error: reference to undefined name 'Errno' > sysinfo.go:2290:16: error: reference to undefined name 'Errno' > sysinfo.go:2281:22: error: reference to undefined name 'Errno' > sysinfo.go:2349:16: error: reference to undefined name 'Errno' > /users/joel/test-gcc/gcc-svn/libgo/go/syscall/libcall_support.go:11:17: > error: use of undefined type 'Errno'
I committed this patch which should fix this problem, or at least move it closer to a fix. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Commited to mainline. Ian
diff -r e8ae01eeedc9 libgo/Makefile.am --- a/libgo/Makefile.am Wed Dec 14 07:38:40 2011 -0800 +++ b/libgo/Makefile.am Wed Dec 14 22:50:35 2011 -0800 @@ -1549,6 +1549,7 @@ go_base_syscall_files = \ go/syscall/env_unix.go \ + go/syscall/syscall_errno.go \ go/syscall/libcall_support.go \ go/syscall/libcall_posix.go \ go/syscall/socket.go \ diff -r e8ae01eeedc9 libgo/go/syscall/syscall_errno.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgo/go/syscall/syscall_errno.go Wed Dec 14 22:50:35 2011 -0800 @@ -0,0 +1,26 @@ +// Copyright 2009 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. + +package syscall + +// An Errno is an unsigned number describing an error condition. +// It implements the error interface. The zero Errno is by convention +// a non-error, so code to convert from Errno to error should use: +// err = nil +// if errno != 0 { +// err = errno +// } +type Errno uintptr + +func (e Errno) Error() string { + return Errstr(int(e)) +} + +func (e Errno) Temporary() bool { + return e == EINTR || e == EMFILE || e.Timeout() +} + +func (e Errno) Timeout() bool { + return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT +} diff -r e8ae01eeedc9 libgo/go/syscall/syscall_unix.go --- a/libgo/go/syscall/syscall_unix.go Wed Dec 14 07:38:40 2011 -0800 +++ b/libgo/go/syscall/syscall_unix.go Wed Dec 14 22:50:35 2011 -0800 @@ -157,25 +157,3 @@ func Munmap(b []byte) (err error) { return mapper.Munmap(b) } - - -// An Errno is an unsigned number describing an error condition. -// It implements the error interface. The zero Errno is by convention -// a non-error, so code to convert from Errno to error should use: -// err = nil -// if errno != 0 { -// err = errno -// } -type Errno uintptr - -func (e Errno) Error() string { - return Errstr(int(e)) -} - -func (e Errno) Temporary() bool { - return e == EINTR || e == EMFILE || e.Timeout() -} - -func (e Errno) Timeout() bool { - return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT -}