public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "afb at users dot sourceforge.net" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-46986-4-kKN12Ydnp9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46986-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46986

--- Comment #12 from Anders F Björklund <afb at users dot sourceforge.net> 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
===================================================================
--- 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() <= length)
+  if (this->data_.length() >= length)
     {
       *bytes = this->data_.data();
       return true;
@@ -854,7 +854,7 @@
       return false;
     }

-  if (lseek(this->fd_, - got, SEEK_CUR) != 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) != 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) ?


  parent reply	other threads:[~2011-09-02 11:08 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17  0:59 [Bug go/46986] New: Fails to build due to -Werror with --disable-werror manphiz at gmail dot com
2010-12-17  1:08 ` [Bug go/46986] Go is not supported on Darwin pinskia at gcc dot gnu.org
2011-01-05  5:37 ` ian at airs dot com
2011-02-26 23:42 ` comexk at gmail dot com
2011-02-27  0:24 ` comexk at gmail dot com
2011-04-21  0:19 ` ian at airs dot com
2011-04-28 16:47 ` rguenth at gcc dot gnu.org
2011-09-01 18:10 ` afb at users dot sourceforge.net
2011-09-01 18:11 ` afb at users dot sourceforge.net
2011-09-01 22:49 ` howarth at nitro dot med.uc.edu
2011-09-02  6:40 ` afb at users dot sourceforge.net
2011-09-02  8:46 ` afb at users dot sourceforge.net
2011-09-02  9:07 ` afb at users dot sourceforge.net
2011-09-02 11:08 ` afb at users dot sourceforge.net [this message]
2011-09-02 11:11 ` afb at users dot sourceforge.net
2011-09-04 17:30 ` howarth at nitro dot med.uc.edu
2011-09-04 18:15 ` afb at users dot sourceforge.net
2011-09-05 14:03 ` afb at users dot sourceforge.net
2011-12-14  1:53 ` ian at airs dot com
2012-02-14 20:00 ` ian at airs dot com
2012-02-15 22:24 ` afb at users dot sourceforge.net
2012-02-15 22:30 ` afb at users dot sourceforge.net
2012-02-15 22:32 ` afb at users dot sourceforge.net
2012-02-15 22:48 ` afb at users dot sourceforge.net
2012-02-15 23:40 ` mrs at gcc dot gnu.org
2012-02-16  3:57 ` howarth at nitro dot med.uc.edu
2012-02-16 14:44 ` howarth at nitro dot med.uc.edu
2012-02-16 15:53 ` ian at airs dot com
2012-02-16 16:31 ` howarth at nitro dot med.uc.edu
2012-02-16 16:54 ` ian at airs dot com
2012-02-16 19:34 ` afb at users dot sourceforge.net
2012-02-16 19:36 ` afb at users dot sourceforge.net
2012-02-16 19:40 ` afb at users dot sourceforge.net
2012-02-16 19:44 ` afb at users dot sourceforge.net
2012-02-18 14:09 ` afb at users dot sourceforge.net
2012-02-18 14:17 ` afb at users dot sourceforge.net
2012-02-18 15:25 ` afb at users dot sourceforge.net
2013-01-24 18:14 ` ian at gcc dot gnu.org
2013-01-24 19:44 ` ian at gcc dot gnu.org
2013-02-05 22:38 ` ian at airs dot com
2021-07-24  5:09 ` egallager at gcc dot gnu.org
2021-07-24 23:40 ` ian at airs dot com
2022-10-30  7:14 ` vital.had at gmail dot com
2022-10-30 17:15 ` ian at airs dot com
2022-10-30 17:19 ` iains at gcc dot gnu.org
2022-10-30 17:25 ` ian at airs dot com
2022-10-30 17:41 ` vital.had at gmail dot com
2022-10-30 18:14 ` iains at gcc dot gnu.org
2023-10-08  5:33 ` vital.had at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46986-4-kKN12Ydnp9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).