From patchwork Mon Jan 24 13:48:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 80157 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 A749AB710E for ; Tue, 25 Jan 2011 00:48:22 +1100 (EST) Received: (qmail 15247 invoked by alias); 24 Jan 2011 13:48:20 -0000 Received: (qmail 15196 invoked by uid 22791); 24 Jan 2011 13:48:19 -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; Mon, 24 Jan 2011 13:48:09 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id AF0078F1; Mon, 24 Jan 2011 14:48:06 +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 xhnk-7POSyMC; Mon, 24 Jan 2011 14:48:04 +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 D7E108F0; Mon, 24 Jan 2011 14:48:03 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p0ODm3ah007720; Mon, 24 Jan 2011 14:48:03 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: Fix remaining libgo testsuite failures on Solaris 2 Date: Mon, 24 Jan 2011 14:48:03 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (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 The recent merge of libgo from upstream broke bootstrap with Go on Solaris: unless _XOPEN_SOURCE is defined as 400 or above, struct msghdr has no msg_control, msg_controllen, and msg_flags members, but uses msg_accrights and msg_accrightslen instead. I've fixed this (and the bootstrap) like this in mksysinfo.sh: I think we really need to introduce the target_triplet arg to mksysinfo.sh again which I already had in my original Solaris libgo patch. I really doubt that we can find macros which make those parts/versions of libc visible that are needed in libgo, but have no ill effect on other platforms. While this restores libgo bootstrap, there are several other issues that need to be dealt with: * In go/time/zoneinfo_unix.go, zoneDir is /usr/share/lib/zoneinfo/ on Solaris, not /usr/share/zoneinfo/. Hardcoding this change fixes time/check, but of course this isn't appropriate. * We need to avoid unconditionally using -Wl,--whole-archive, which is only available with GNU ld (and, rarely, vendor linkers like the Solaris 11 ld that also implement it). * Currently, go/os/sys_linux.go is used everywhere which doesn't work since only Linux has /proc/sys/kernel/hostname. I wonder what the best solution is, though: Solaris /bin/hostname uses sysinfo(SI_HOSTNAME), there's also gethostname(3C) and of course uname(2). * There are several more functions that need largefile variants on 32-bit Solaris: readdir_r needs to use readdir64_r and Dirent needs to correspond to _dirent64 stat, fstat and lstat need to use *stat64, and Stat needs to become _stat64. There may be more instances, but those are the easy ones so far. I'm unsure where best to place those declarations: *stat might go into syscalls/sysfile_stat{regfile, largefile}.go readdir_r is currently in go/os/dir.go, but the variants obviously should go somewhere into syscalls. There are also a couple of testsuite issues: * At least the 64-bit compress/gzip/check hangs on Solaris 11/x86, which hangs the whole testsuite run. This is already dealt with nicely by DejaGnu. * The non-DejaGnu make check only prints it output to stdout, so no record of the testsuite run is kept that would show up in mail-report.log. * Even a sequential make check run with use_dejagnu=yes is pretty useless: the individal tests are all run with they own runtest invocation, but inside the same directory (testsuite). This way, libgo.{log,sum} from the next testcase overwrites the previous one. Even so, every test is called go, so all you see is FAIL: go Not very useful ;-( Thanks. Rainer diff -r 77ad95adb9e1 libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh Sun Jan 23 23:05:50 2011 +0100 +++ b/libgo/mksysinfo.sh Sun Jan 23 23:08:31 2011 +0100 @@ -57,7 +57,8 @@ #include EOF -${CC} -D_GNU_SOURCE -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c +#${CC} -D_GNU_SOURCE -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c +${CC} -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c echo 'package syscall' > ${OUT}