From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1004 invoked by alias); 20 May 2011 16:44:36 -0000 Received: (qmail 983 invoked by uid 22791); 20 May 2011 16:44:35 -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; Fri, 20 May 2011 16:44:21 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id B13B4FCF; Fri, 20 May 2011 18:44:19 +0200 (CEST) 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 ZQMzGa9ZNot0; Fri, 20 May 2011 18:44:16 +0200 (CEST) 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 CBDCCFCE; Fri, 20 May 2011 18:44:16 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p4KGiGs6014549; Fri, 20 May 2011 18:44:16 +0200 (MEST) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Re: Go patch committed: Update to current Go library References: Date: Fri, 20 May 2011 18:26:00 -0000 In-Reply-To: (Rainer Orth's message of "Fri, 20 May 2011 15:44:07 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01494.txt.bz2 Rainer Orth writes: > IRIX might have similar issues, I'm currently checking. It didn't, but there are two others: /vol/gcc/src/hg/trunk/local/libgo/runtime/go-setenv.c: In function 'setenv_c': /vol/gcc/src/hg/trunk/local/libgo/runtime/go-setenv.c:44:3: error: implicit declaration of function 'setenv' [-Werror=implicit-function-declaration] One needs to check for putenv vs. setenv and handle that in go-setenv.c. I've hacked around the issue for the moment to at least let bootstrap succeed. Besides, there are many errors compiling cgo_unix.go and cgo_linux.go: /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:23:57: error: expected type /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:23:81: error: expected type /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:24:29: error: expected type /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:36:11: error: expected type /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:37:12: error: expected type /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:82:11: error: expected type /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:83:12: error: expected type sysinfo.go lacks Addrinfo here. /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:91:34: error: reference to undefined identifier 'syscall.AI_ALL' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:91:51: error: reference to undefined identifier 'syscall.AI_V4MAPPED' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:91:73: error: reference to undefined identifier 'syscall.AI_CANONNAME' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:97:24: error: reference to undefined identifier 'syscall.EAI_NONAME' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_unix.go:99:31: error: reference to undefined identifier 'syscall.EAI_SYSTEM' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_linux.go:14:17: error: reference to undefined identifier 'syscall.AI_CANONNAME' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_linux.go:14:40: error: reference to undefined identifier 'syscall.AI_V4MAPPED' /vol/gcc/src/hg/trunk/local/libgo/go/net/cgo_linux.go:14:62: error: reference to undefined identifier 'syscall.AI_ALL' All those errors are caused by the fact that only exposes struct addrinfo and the AI_* and EAI_* defines if _NO_XOPEN4 && _NO_XOPEN5, but we need _XOPEN_SOURCE=500 for other reasons. So I've again chosen to hardcode them in socket_irix.go. With this patch (and the setenv/putenv hack), I've been able to successfully build libgo.so on IRIX 6.5. Rainer 2011-05-20 Rainer Orth libgo: * syscalls/socket_irix.go (Addrinfo): Define. Declare AI_*, EAI_* constants. diff --git a/libgo/syscalls/socket_irix.go b/libgo/syscalls/socket_irix.go --- a/libgo/syscalls/socket_irix.go +++ b/libgo/syscalls/socket_irix.go @@ -82,3 +82,44 @@ type IpMreq struct { Multiaddr [4]byte Interface [4]byte } + +// Similarly, only provides struct addrinfo, AI_* and EAI_* if +// _NO_XOPEN4 && _NO_XOPEN5. +type Addrinfo struct { + Ai_flags int32 + Ai_family int32 + Ai_socktype int32 + Ai_protocol int32 + Ai_addrlen int32 + Ai_canonname *uint8 + Ai_addr *_sockaddr + Ai_next *Addrinfo +} + +const ( + AI_PASSIVE = 0x00000001 + AI_CANONNAME = 0x00000002 + AI_NUMERICHOST = 0x00000004 + AI_NUMERICSERV = 0x00000008 + AI_ALL = 0x00000100 + AI_ADDRCONFIG = 0x00000400 + AI_V4MAPPED = 0x00000800 + AI_DEFAULT = (AI_V4MAPPED | AI_ADDRCONFIG) +) + +const ( + EAI_ADDRFAMILY = 1 + EAI_AGAIN = 2 + EAI_BADFLAGS = 3 + EAI_FAIL = 4 + EAI_FAMILY = 5 + EAI_MEMORY = 6 + EAI_NODATA = 7 + EAI_NONAME = 8 + EAI_SERVICE = 9 + EAI_SOCKTYPE = 10 + EAI_SYSTEM = 11 + EAI_BADHINTS = 12 + EAI_OVERFLOW = 13 + EAI_MAX = 14 +) -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University