From patchwork Fri Mar 2 21:07:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 144357 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 ECAF21007D3 for ; Sat, 3 Mar 2012 08:08:20 +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=1331327301; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF: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=8MVh4E74FDUWL2ksGvQjDdEuUtA=; b=JYe1vkNmca63X4i az1eXOm1sDMdhILx3g5hgw+PjeItW5ZHy/9nyzjDeY+s6ju70WlOlXGWmhGImNHI 5As6EYdM8aONaWgQKyQUyd7kBM7E1SqGRy7Kz1VF0nw+Y7xbcCtwTMNOFr1sisuf zAEB7h96ROwPGlwod62WoDZh6c40= 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-SPF:Authentication-Results:Received:Received:Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=DoqU+CkcTr9FVf6vBAbxhaldmwIc2lgd6M1IenFkgOoi9VjWGoaputVsgoe+mr I3ZAi+Tm85QZSTOmEl9C4L8uPhs2Q0gAqS6gK8RZWqQzRrsBEusPEIIo1pABSjnN Vwshjt/XKPX9kzXGymTnLGv5W91ZRViPGygNhbDl6uypM=; Received: (qmail 5384 invoked by alias); 2 Mar 2012 21:08:16 -0000 Received: (qmail 5369 invoked by uid 22791); 2 Mar 2012 21:08:14 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mail-pz0-f47.google.com (HELO mail-pz0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Mar 2012 21:08:01 +0000 Received: by dado14 with SMTP id o14so2206092dad.20 for ; Fri, 02 Mar 2012 13:08:00 -0800 (PST) Received-SPF: pass (google.com: domain of iant@google.com designates 10.68.216.132 as permitted sender) client-ip=10.68.216.132; Authentication-Results: mr.google.com; spf=pass (google.com: domain of iant@google.com designates 10.68.216.132 as permitted sender) smtp.mail=iant@google.com; dkim=pass header.i=iant@google.com Received: from mr.google.com ([10.68.216.132]) by 10.68.216.132 with SMTP id oq4mr21132821pbc.41.1330722480439 (num_hops = 1); Fri, 02 Mar 2012 13:08:00 -0800 (PST) Received: by 10.68.216.132 with SMTP id oq4mr17663840pbc.41.1330722480395; Fri, 02 Mar 2012 13:08:00 -0800 (PST) Received: by 10.68.216.132 with SMTP id oq4mr17663795pbc.41.1330722480200; Fri, 02 Mar 2012 13:08:00 -0800 (PST) Received: from coign.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net. [71.133.8.30]) by mx.google.com with ESMTPS id y9sm5925734pbi.3.2012.03.02.13.07.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Mar 2012 13:07:59 -0800 (PST) From: Ian Lance Taylor To: Rainer Orth Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Re: libgo patch committed: Fill out syscall package for GNU/Linux References: Date: Fri, 02 Mar 2012 13:07:58 -0800 In-Reply-To: (Rainer Orth's message of "Fri, 02 Mar 2012 20:10:48 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQm3ghAocSGYG7w6SoGhlWybN2Mintd1FHsBkooVD2xEeojfZsmD5HUnuUGpTGuqxbJiJa7fkITw5cMY9XWELDs8V2DMCOBbomlONDeNwVZzjumAHpeCoN/lzkoNYK2EUjE6j/USA4zSnIWwYg670LM/n+uBN2ak6NvV6P/oto0yKPgx5Hw= 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 Rainer Orth writes: > Rainer Orth writes: > >> Ian Lance Taylor writes: >> >>> This patch to libgo fills out the syscall package for GNU/Linux to match >>> all the functions in the syscall package in the master Go library. >>> There is a test case for this patch at >>> http://code.google.com/p/go/issues/detail?id=3071 . Bootstrapped and >>> ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. >> >> Unfortunately, this broke Solaris bootstrap: > > It also broke Linux/x86_64 bootstrap (CentOS 5.6): > > In file included from /usr/include/sys/ustat.h:30:0, > from /usr/include/ustat.h:1, > from sysinfo.c:91: > /usr/include/bits/ustat.h:25:8: error: redefinition of 'struct ustat' > In file included from /usr/include/linux/filter.h:8:0, > from sysinfo.c:61: > /usr/include/linux/types.h:156:8: note: originally defined here Thanks for the note. I committed this patch in an attempt to fix these problems. Ian diff -r 0f5b89756b90 libgo/configure.ac --- a/libgo/configure.ac Fri Mar 02 12:47:45 2012 -0800 +++ b/libgo/configure.ac Fri Mar 02 13:06:49 2012 -0800 @@ -453,7 +453,7 @@ ;; esac -AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h ustat.h utime.h linux/reboot.h) +AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/reboot.h) AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [], [#ifdef HAVE_SYS_SOCKET_H @@ -461,6 +461,21 @@ #endif ]) +AC_CACHE_CHECK([whether can be used], +[libgo_cv_c_ustat_h], +AC_COMPILE_IFELSE( +[AC_LANG_SOURCE([ +#include +#ifdef HAVE_LINUX_FILTER_H +#include +#endif +#include +])], [libgo_cv_c_ustat_h=yes], [libgo_cv_c_ustat_h=no])) +if test $libgo_cv_c_ustat_h = yes; then + AC_DEFINE(HAVE_USTAT_H, 1, + [Define to 1 if you have the header file and it works.]) +fi + AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes) AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv) diff -r 0f5b89756b90 libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh Fri Mar 02 12:47:45 2012 -0800 +++ b/libgo/mksysinfo.sh Fri Mar 02 13:06:49 2012 -0800 @@ -895,6 +895,11 @@ -e 's/f_fname/Fname/' \ -e 's/f_fpack/Fpack/' \ >> ${OUT} +# Force it to be defined, as on some older GNU/Linux systems the +# header file fails when using with . +if ! grep 'type _ustat ' gen-sysinfo.go >/dev/null 2>&1; then + echo 'type Ustat_t struct { Tfree int32; Tinoe uint64; Fname [5+1]int8; Fpack [5+1]int8; }' >> ${OUT} +fi # The utimbuf struct. grep '^type _utimbuf ' gen-sysinfo.go | \