From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31441 invoked by alias); 2 Sep 2011 11:08:19 -0000 Received: (qmail 31431 invoked by uid 22791); 2 Sep 2011 11:08:18 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BJ,TW_JC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Sep 2011 11:08:05 +0000 From: "afb at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug go/46986] Go is not supported on Darwin Date: Fri, 02 Sep 2011 11:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: go X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: afb at users dot sourceforge.net X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ian at airs dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00130.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D46986 --- Comment #12 from Anders F Bj=C3=B6rklund 2011-09-02 11:07:33 UTC --- > It doesn't include the objcopy header, > but I believe that is skipped anyway ? Or at least it was *supposed* to ignore it, but the Stream_from_file was horribly buggy. (apparently has a dyslectic problem with comparisons, aggrevated by copy/paste ?) It always returned "" instead of any data, so failed to provide the required magic... (or any other data beyond that, if asked) Fixing that class, and it works just fine: Index: gcc/go/gofrontend/import.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/go/gofrontend/import.cc (revision 178444) +++ gcc/go/gofrontend/import.cc (working copy) @@ -836,7 +836,7 @@ bool Stream_from_file::do_peek(size_t length, const char** bytes) { - if (this->data_.length() <=3D length) + if (this->data_.length() >=3D length) { *bytes =3D this->data_.data(); return true; @@ -854,7 +854,7 @@ return false; } - if (lseek(this->fd_, - got, SEEK_CUR) !=3D 0) + if (lseek(this->fd_, - got, SEEK_CUR) < 0) { if (!this->saw_error()) error("lseek failed: %m"); @@ -876,7 +876,7 @@ void Stream_from_file::do_advance(size_t skip) { - if (lseek(this->fd_, skip, SEEK_CUR) !=3D 0) + if (lseek(this->fd_, skip, SEEK_CUR) < 0) { if (!this->saw_error()) error("lseek failed: %m"); That bug should affect any other platform too, if trying to use "naked" .gox (without object) ?