9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: lucio@proxima.alt.za
To: 9fans@9fans.net
Subject: Re: [9fans] Go: CGO and Plan 9
Date: Sat,  2 Feb 2013 17:41:12 +0200	[thread overview]
Message-ID: <524bfce5fdfb1813d4348d11bc3f1835@proxima.alt.za> (raw)
In-Reply-To: <CAEAzY395bTyA0_6Oc18x3VPBOEXN0hC371QAW7N4oLN7h14n8w@mail.gmail.com>

> ?c and ?g use the same calling convention, and segmented stacks are
> implemented by the linker. You don't need cgo in order to call C code
> from Go. Why do you want cgo?
>
> Look at the various C files in the Go standard library, especially
> inside runtime. Those are compiled with the Plan 9 compiler and Go
> calls it just fine.

Thanks for the reply (you and Pavel Zholkover, so far).  As I
mentioned, it's not that I "want cgo", it's that I need to get my mind
around the issue and it is just too complicated.  It would be a
beneficial side effect if I can get OpenLDAP (client utilities)
working at the same time, but the moment I have a mental image of what
is actually going on, getting down to tacks will be easy enough.

So what I'm asking is for help in understanding how what is already
hard to understand in the GCC context where it is "documented" can in
fact be mirrored in the Plan 9 context, where it ought to be "native".
There are just way too many mirrors in this hall!  And my mind isn't
trained to separate them out.

Sorry to cast my problems at 9fans, I've tried to make sense of it
all, but I haven't been able to separate out the details, my brain
just insists in trying to tie everything together at once.  With a bit
of luck, contributions from here will reveal something I've been
missing.

In passing, dhog's GCC port to Plan 9 clarified a little the issue of
different call conventions, but I think that's adding to my confusion,
now.

++L




      parent reply	other threads:[~2013-02-02 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  4:41 lucio
2013-02-01 17:52 ` Pavel Zholkover
2013-02-02 14:28 ` Aram Hăvărneanu
2013-02-02 15:24   ` Anthony Martin
2013-02-02 15:52     ` lucio
2013-02-02 15:41   ` lucio [this message]

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=524bfce5fdfb1813d4348d11bc3f1835@proxima.alt.za \
    --to=lucio@proxima.alt.za \
    --cc=9fans@9fans.net \
    /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 NNTP newsgroup(s).