From patchwork Mon May 2 08:28:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 93609 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 87720B6F64 for ; Mon, 2 May 2011 18:28:42 +1000 (EST) Received: (qmail 7824 invoked by alias); 2 May 2011 08:28:40 -0000 Received: (qmail 7813 invoked by uid 22791); 2 May 2011 08:28:39 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST 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; Mon, 02 May 2011 08:28:25 +0000 Received: by pzk36 with SMTP id 36so3388586pzk.20 for ; Mon, 02 May 2011 01:28:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.149.15 with SMTP id w15mr3148829wfd.325.1304324905289; Mon, 02 May 2011 01:28:25 -0700 (PDT) Received: by 10.143.158.12 with HTTP; Mon, 2 May 2011 01:28:25 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 May 2011 10:28:25 +0200 Message-ID: Subject: Re: [RFC PATCH, go]: Port to ALPHA arch - sysinfo.go fixup From: Uros Bizjak To: Ian Lance Taylor Cc: Rainer Orth , gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com 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 On Fri, Apr 22, 2011 at 1:39 AM, Ian Lance Taylor wrote: > Rainer Orth writes: > >> Here's the error I run into: >> >> /vol/gcc/src/hg/trunk/irix/libgo/go/os/file.go:432:12: error: incompatible types in assignment (implicit assignment of 'syscall.Timeval' hidden field '_f0') >> /vol/gcc/src/hg/trunk/irix/libgo/go/os/file.go:433:12: error: incompatible types in assignment (implicit assignment of 'syscall.Timeval' hidden field '_f0') >> /vol/gcc/src/hg/trunk/irix/libgo/go/os/file.go:434:37: error: argument 2 has incompatible type (implicit assignment of 'syscall.Timeval' hidden field '_f0') >> make[8]: *** [os/os.lo] Error 1 >> >>> What does the line for timeval look like in gen-sysinfo.go? >> >> I get >> >> type Timeval struct { _f0 int32; Sec Timeval_sec_t; Usec Timeval_usec_t; } > > Thanks.  I fixed this problem with this patch.  Bootstrapped and ran Go > testsuite on x86_64-unknown-linux-gnu.  Committed to mainline. > > Ian > > > 2011-04-21  Ian Lance Taylor   > >        * godump.c (go_format_type): Use exported Go name for anonymous >        field name. This still doesn't fix the build for alpha due to extra struct. From sysinfo.go: type Timespec struct { Sec Timespec_sec_t; Nsec Timespec_nsec_t; } type Stat_t struct { Dev uint64; Ino uint64; Rdev uint64; Size int64; Blocks uint64; Mode uint32; Uid uint32; Gid uint32; Blksize uint32; Nlink uint32; __pad0 int32; Go0 struct { Atime Timespec; }; Go1 struct { Mtime Timespec; }; Go2 struct { Ctime Timespec; }; __unused [2+1]int64; } Following patch enables the build to proceed: (BTW: Original calculation of Ctime_ns has a cut'n'paste error, stat.Ctime.Nsec should be used instead of stat.Atime.Nsec). Is there a solution for this problem? Uros. Index: go/os/stat.go =================================================================== --- go/os/stat.go (revision 173234) +++ go/os/stat.go (working copy) @@ -23,9 +23,9 @@ fi.Size = int64(stat.Size) fi.Blksize = int64(stat.Blksize) fi.Blocks = int64(stat.Blocks) - fi.Atime_ns = int64(stat.Atime.Sec)*1e9 + int64(stat.Atime.Nsec) - fi.Mtime_ns = int64(stat.Mtime.Sec)*1e9 + int64(stat.Mtime.Nsec) - fi.Ctime_ns = int64(stat.Ctime.Sec)*1e9 + int64(stat.Atime.Nsec) + fi.Atime_ns = int64(stat.Go0.Atime.Sec)*1e9 + int64(stat.Go0.Atime.Nsec) + fi.Mtime_ns = int64(stat.Go1.Mtime.Sec)*1e9 + int64(stat.Go1.Mtime.Nsec) + fi.Ctime_ns = int64(stat.Go2.Ctime.Sec)*1e9 + int64(stat.Go2.Ctime.Nsec) for i := len(name)-1; i >= 0; i-- { if name[i] == '/' { name = name[i+1:]