From patchwork Fri Jan 27 10:56:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 138207 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 44972B6F67 for ; Fri, 27 Jan 2012 21:56:59 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1328266620; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To: Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=ubSh1DwrWXcFKDfWoDfgIkXCp88=; b=FRXHsxYjku0agHoIhHu4akNTnQZjm+nq2xn0e8194n3XgoyhhvHuk8wG2ULcA5 DAXGmP/sx03E/qhxTnmb/bqoNIf992WW2vK0y/kpVFM3ULHeRwcTQhsGnlGBB5MN 9QROiJTJWLTvf8b6LHIGH5C/bM0KW/hjLv6unvkBMTeFw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=xelTUKPvKNcrhfuDZtY7VYuVm40LVpVkOLSVkwKOs3FhlczKp/gHM5lKufdPm3 XTP4Tk3nzSQwE9+ufS7ncBuwtxVf8RWBaTOCMXhm0PWd4sydK8KCAJl+2e7qWUSr PeC2oLg3U/ZbS25MTJHWeOjm+G/hdFPviycOvQAqZC5lg=; Received: (qmail 1943 invoked by alias); 27 Jan 2012 10:56:53 -0000 Received: (qmail 1933 invoked by uid 22791); 27 Jan 2012 10:56:51 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS 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; Fri, 27 Jan 2012 10:56:36 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id A37B374; Fri, 27 Jan 2012 11:56:34 +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 CD7CR54V8LiK; Fri, 27 Jan 2012 11:56:30 +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 A3EB320; Fri, 27 Jan 2012 11:56:30 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q0RAuU9D001914; Fri, 27 Jan 2012 11:56:30 +0100 (MET) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Re: libgo patch committed: Update to weekly.2012-01-20 References: Date: Fri, 27 Jan 2012 11:56:29 +0100 In-Reply-To: (Ian Lance Taylor's message of "Wed, 25 Jan 2012 13:54:24 -0800") 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 Ian Lance Taylor writes: > I have committed a patch to libgo to update to the weekly.2012-01-20 > release. As usual this e-mail message only includes changes to files > specific to gccgo. Bootstrapped and ran Go testsuite on > x86_64-unknown-linux-gnu. Committed to mainline. This patch (or the previous one, I haven't checked in detail) caused a couple of problems on Solaris: /vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_bsd.go:10:9: error: imported and not used: runtime Even after fixing all subsequent errors, runtime isn't used. /vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_bsd.go:61:10: error: reference to undefined name 'raw_trace' // Enable tracing if requested. if sys.Ptrace { err1 = raw_trace(_PTRACE_TRACEME, 0, nil, nil) This needs to be raw_ptrace instead, it seems. /vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_bsd.go:156:31: error: reference to undefined name 'F_CLOEXEC' raw_fcntl(nextfd, F_SETFD, F_CLOEXEC) This is rather spelled FD_CLOEXEC. /vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_bsd.go:199:26: error: reference to undefined name 'IOTCNOTTY' _, err1 = raw_ioctl(0, IOTCNOTTY, 0) Doesn't exist either, typo for TIOCNOTTY, it seems. /vol/gcc/src/hg/trunk/local/libgo/go/syscall/exec_bsd.go:207:13: error: not enough arguments _, err1 = raw_ioctl(TIOCSCTTY, 0) Missing 0 arg. /vol/gcc/src/hg/trunk/local/libgo/go/os/sys_uname.go:11:1: error: redefinition of 'Hostname' Need hostname() here /vol/gcc/src/hg/trunk/local/libgo/go/os/doc.go:15:1: note: previous definition of 'Hostname' was here /vol/gcc/src/hg/trunk/local/libgo/go/os/doc.go:16:9: error: reference to undefined name 'hostname' After those fixes, libgo builds again on Solaris 10/x86 and 11/SPARC. On Solaris 8/x86, there's more: /vol/gcc/src/hg/trunk/local/libgo/runtime/go-print.c: In function '__go_print_do uble': /vol/gcc/src/hg/trunk/local/libgo/runtime/go-print.c:61:3: error: implicit decla ration of function 'isinf' [-Werror=implicit-function-declaration] cc1: all warnings being treated as errors There's no isinf in system headers, I've chosen to use __builtin_isinf instead. Undefined first referenced symbol in file runtime_goenvs /var/gcc/regression/trunk/10-gcc/build/i386-pc-solaris2.10/libgo/.libs/libgo.so Currently defined in runtime/thread-linux.c only, need to add to thread-sema.c, too. /vol/gcc/src/hg/trunk/local/libgo/go/net/sockoptip_linux.go:95:69: error: refere nce to undefined identifier 'syscall.IP_PKTINFO' make[4]: *** [net/net.lo] Error 1 Provide fallback definition via mksysinfo.sh. With those changes, libgo also builds on Solaris 8/x86 again, but lots of undefined references to C99 math functions remain, so the result is pretty useless. I'm also checking IRIX 6.5 right now. This patch is what I'm using for Solaris. Rainer diff --git a/libgo/go/os/sys_uname.go b/libgo/go/os/sys_uname.go --- a/libgo/go/os/sys_uname.go +++ b/libgo/go/os/sys_uname.go @@ -8,7 +8,7 @@ package os import "syscall" -func Hostname() (name string, err error) { +func hostname() (name string, err error) { var u syscall.Utsname if errno := syscall.Uname(&u); errno != nil { return "", NewSyscallError("uname", errno) diff --git a/libgo/go/syscall/exec_bsd.go b/libgo/go/syscall/exec_bsd.go --- a/libgo/go/syscall/exec_bsd.go +++ b/libgo/go/syscall/exec_bsd.go @@ -7,7 +7,6 @@ package syscall import ( - "runtime" "unsafe" ) @@ -58,7 +57,7 @@ func forkAndExecInChild(argv0 *byte, arg // Enable tracing if requested. if sys.Ptrace { - err1 = raw_trace(_PTRACE_TRACEME, 0, nil, nil) + err1 = raw_ptrace(_PTRACE_TRACEME, 0, nil, nil) if err1 != 0 { goto childerror } @@ -153,7 +152,7 @@ func forkAndExecInChild(argv0 *byte, arg err1 = err2.(Errno) goto childerror } - raw_fcntl(nextfd, F_SETFD, F_CLOEXEC) + raw_fcntl(nextfd, F_SETFD, FD_CLOEXEC) fd[i] = nextfd nextfd++ if nextfd == pipe { // don't stomp on pipe @@ -196,7 +195,7 @@ func forkAndExecInChild(argv0 *byte, arg // Detach fd 0 from tty if sys.Noctty { - _, err1 = raw_ioctl(0, IOTCNOTTY, 0) + _, err1 = raw_ioctl(0, TIOCNOTTY, 0) if err1 != 0 { goto childerror } @@ -204,7 +203,7 @@ func forkAndExecInChild(argv0 *byte, arg // Make fd 0 the tty if sys.Setctty { - _, err1 = raw_ioctl(TIOCSCTTY, 0) + _, err1 = raw_ioctl(0, TIOCSCTTY, 0) if err1 != 0 { goto childerror } diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -192,7 +192,7 @@ grep '^const _SHUT_' gen-sysinfo.go | sed -e 's/^\(const \)_\(SHUT[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} # The net package requires some const definitions. -for m in IPV6_V6ONLY IPPROTO_IPV6 IPV6_JOIN_GROUP IPV6_LEAVE_GROUP IPV6_TCLASS; do +for m in IP_PKTINFO IPV6_V6ONLY IPPROTO_IPV6 IPV6_JOIN_GROUP IPV6_LEAVE_GROUP IPV6_TCLASS; do if ! grep "^const $m " ${OUT} >/dev/null 2>&1; then echo "const $m = 0" >> ${OUT} fi diff --git a/libgo/runtime/go-print.c b/libgo/runtime/go-print.c --- a/libgo/runtime/go-print.c +++ b/libgo/runtime/go-print.c @@ -58,7 +58,7 @@ __go_print_double (double v) fputs ("NaN", stderr); return; } - if (isinf (v)) + if (__builtin_isinf (v)) { putc (v < 0 ? '-' : '+', stderr); fputs ("Inf", stderr); diff --git a/libgo/runtime/thread-sema.c b/libgo/runtime/thread-sema.c --- a/libgo/runtime/thread-sema.c +++ b/libgo/runtime/thread-sema.c @@ -136,6 +136,12 @@ runtime_semawakeup (M *mp) } void -runtime_osinit(void) +runtime_osinit (void) { } + +void +runtime_goenvs (void) +{ + runtime_goenvs_unix (); +}