From patchwork Thu Mar 24 16:33:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 88234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 049E8B6F85 for ; Fri, 25 Mar 2011 03:33:56 +1100 (EST) Received: (qmail 22173 invoked by alias); 24 Mar 2011 16:33:52 -0000 Received: (qmail 22161 invoked by uid 22791); 24 Mar 2011 16:33:51 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Mar 2011 16:33:44 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 78D0E79B; Thu, 24 Mar 2011 17:33:40 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5ssfAO3B15ls; Thu, 24 Mar 2011 17:33:37 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 77CB979A; Thu, 24 Mar 2011 17:33:37 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p2OGXU6o018038; Thu, 24 Mar 2011 17:33:30 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: [libgo] Improve Solaris 2/SPARC support Date: Thu, 24 Mar 2011 17:33:30 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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