In order to improve Go test results on Solaris 2/SPARC, I need the
following patch.

* go-test.exp wasn't updated for the change from sparcv9 to sparc64.
  While I still don't agree with the new name, at least the two should
  be consistent.

* env.go needs to accept sparc and sparc64.

* Just like 32-bit Solaris 2/x86, 32-bit Solaris 2/SPARC needs to use
  the largefile variants of several functions.  I've not introduced a
  new LIBGO_IS_SOLARIS32 conditional for that, but perhaps one should?

With this patch, results are considerably improved, though still not
good:  the rpc and websocket tests hang indefinitely, as reported in PR
go/48242, so one cannot include Go in a default bootstrap.  I'll
investigate those shortly.  Apart from that, many tests fail, cf. PR
go/48243.

I'll have a look at them in the future, but wanted the get the
low-hanging fruit out of the door.

        Rainer


2011-03-24  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        go:
        * go.test/go-test.exp (go-set-goarch): Use sparc64 for 64-bit SPARC.
        * go.test/test/env.go (main): Handle sparc, sparc64.

        libgo:
        * Makefile.am (go_os_dir_file) [LIBGO_IS_SPARC]: Use
        go/os/dir_largefile.go.
        (syscall_filesize_file) [LIBGO_IS_SPARC]: Use
        syscalls/sysfile_largefile.go.
        (syscall_stat_file) [LIBGO_IS_SPARC]: Use
        syscalls/sysfile_stat_largefile.go.
        * Makefile.in: Regenerate.

diff -r de1b3baf021b gcc/testsuite/go.test/go-test.exp
--- a/gcc/testsuite/go.test/go-test.exp Thu Mar 24 13:19:30 2011 +0100
+++ b/gcc/testsuite/go.test/go-test.exp Thu Mar 24 13:22:43 2011 +0100
@@ -129,7 +129,7 @@
            if [check_effective_target_ilp32] {
                set goarch "sparc"
            } else {
-               set goarch "sparcv9"
+               set goarch "sparc64"
            }
        }
        default {
diff -r de1b3baf021b gcc/testsuite/go.test/test/env.go
--- a/gcc/testsuite/go.test/test/env.go Thu Mar 24 13:19:30 2011 +0100
+++ b/gcc/testsuite/go.test/test/env.go Thu Mar 24 13:22:43 2011 +0100
@@ -1,7 +1,7 @@
 // [ $GOOS != nacl ] || exit 0  # NaCl runner does not expose environment
 // $G $F.go && $L $F.$A && ./$A.out
 
-// Copyright 2009 The Go Authors. All rights reserved.
+// Copyright 2009, 2011 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.
 
@@ -15,7 +15,8 @@
                print("$GOARCH: ", e0.String(), "\n")
                os.Exit(1)
        }
-       if ga != "amd64" && ga != "386" && ga != "arm" {
+       if ga != "386" && ga != "amd64" && ga != "arm" && ga != "sparc" &&
+          ga != "sparc64" {
                print("$GOARCH=", ga, "\n")
                os.Exit(1)
        }
diff -r de1b3baf021b libgo/Makefile.am
--- a/libgo/Makefile.am Thu Mar 24 13:19:30 2011 +0100
+++ b/libgo/Makefile.am Thu Mar 24 13:22:43 2011 +0100
@@ -676,8 +676,12 @@
 if LIBGO_IS_386
 go_os_dir_file = go/os/dir_largefile.go
 else
+if LIBGO_IS_SPARC
+go_os_dir_file = go/os/dir_largefile.go
+else
 go_os_dir_file = go/os/dir_regfile.go
 endif
+endif
 else
 if LIBGO_IS_LINUX
 go_os_dir_file = go/os/dir_largefile.go
@@ -1188,16 +1192,21 @@
 syscall_stat_file = syscalls/sysfile_stat_largefile.go
 else # !LIBGO_IS_LINUX
 if LIBGO_IS_SOLARIS
-# FIXME: Same for sparc vs. sparc64.  Introduce new/additional conditional?
 if LIBGO_IS_386
-# Use lseek64 on 386 Solaris.
+# Use lseek64 on 32-bit Solaris/x86.
 syscall_filesize_file = syscalls/sysfile_largefile.go
 syscall_stat_file = syscalls/sysfile_stat_largefile.go
-else # !LIBGO_IS_LINUX && LIBGO_IS_SOLARIS && !LIBGO_IS_386
-# Use lseek on amd64 Solaris.
+else # !LIBGO_IS_386
+if LIBGO_IS_SPARC
+# Use lseek64 on 32-bit Solaris/SPARC.
+syscall_filesize_file = syscalls/sysfile_largefile.go
+syscall_stat_file = syscalls/sysfile_stat_largefile.go
+else # !LIBGO_IS_386 && !LIBGO_IS_SPARC
+# Use lseek on 64-bit Solaris.
 syscall_filesize_file = syscalls/sysfile_regfile.go
 syscall_stat_file = syscalls/sysfile_stat_regfile.go
-endif # !LIBGO_IS_386
+endif # !LIBGO_IS_386 && !LIBGO_IS_SPARC
+endif # !LIBGO_IS_SOLARIS
 else # !LIBGO_IS_LINUX && !LIBGO_IS_SOLARIS
 # Use lseek by default.
 syscall_filesize_file = syscalls/sysfile_regfile.go

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

Reply via email to