caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gordon Henriksen <gordonhenriksen@mac.com>
To: Julien Moutinho <julien.moutinho@gmail.com>
Cc: Jos Backus <jos@catnook.com>, caml-list@inria.fr
Subject: Re: [Caml-list] undefined symbol `caml_tuplify2' in dynamic rocaml extension
Date: Wed, 1 Aug 2007 09:59:22 -0400	[thread overview]
Message-ID: <16ACAC9F-6006-42A1-85A4-7AAC218F6749@mac.com> (raw)
In-Reply-To: <20070801074422.GA5362@jiyu.gnu>

On Aug 1, 2007, at 03:44, Julien Moutinho wrote:
> On Tue, Jul 31, 2007 at 09:01:02PM -0700, Jos Backus wrote:
>
>> Hi. I'm trying to use rocaml to wrap an Ocaml library so it can be  
>> accessed from a dynamic Ruby extension (using Callback.register).  
>> Everything works, except when I try to access the Ocaml type from  
>> Ruby the following Ruby LoadError is emitted:
>>
>>     undefined symbol: caml_tuplify2
>>
>> So my question is: what do I need to do in order to satisfy this  
>> symbol? It doesn't appear in any library. ocaml version is 3.09.2.
>
> AFAICS, when needed, caml_tuplifyN end up within the /tmp/ 
> camlstartup*.s file mechanically generated at link time. You can  
> keep this file with -dstartup.
>
> Unfortunately, due to its quasi-random name, it is not easy to  
> retrieve it mechanically.
>
> Personally I have patched ocamlopt in order to have a -startup  
> option keeping camlstartup_<name_of_the_output>.o in the current  
> directory.
>
> Anyway, maybe there is a better way for your own concern. Have a  
> glance at -output-obj perhaps.
>
> HTH.

I wonder if there's a reason ocamlopt doesn't simply emit these glue  
functions alongside their uses as linkonce symbols. This is the same  
technique that a C++ compiler uses for template instantiations to  
avoid problems of this nature.

— Gordon




  parent reply	other threads:[~2007-08-01 13:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01  4:01 Jos Backus
2007-08-01  7:44 ` [Caml-list] " Julien Moutinho
2007-08-01  9:43   ` Mauricio Fernandez
2007-08-01 13:59   ` Gordon Henriksen [this message]
2007-08-01  9:16 ` Mauricio Fernandez
2007-08-01 16:17   ` Jos Backus
2007-08-01 17:59     ` Jos Backus
2007-08-01 23:24       ` [Caml-list] undefined symbol `caml_tuplify2' in dynamic rocaml extension (UPDATE) Jos Backus
2007-08-02  9:20         ` Mauricio Fernandez
2007-08-02  9:58           ` Mauricio Fernandez
2007-08-02 18:54             ` Jos Backus
2007-08-02 18:58           ` Jos Backus
2007-08-01 23:34       ` rocaml bug + fix Jos Backus

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=16ACAC9F-6006-42A1-85A4-7AAC218F6749@mac.com \
    --to=gordonhenriksen@mac.com \
    --cc=caml-list@inria.fr \
    --cc=jos@catnook.com \
    --cc=julien.moutinho@gmail.com \
    /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).