Version française
Home     About     Download     Resources     Contact us    
Browse thread
undefined symbol `caml_tuplify2' in dynamic rocaml extension
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jos Backus <jos@c...>
Subject: Re: [Caml-list] undefined symbol `caml_tuplify2' in dynamic rocaml extension
On Wed, Aug 01, 2007 at 11:16:47AM +0200, Mauricio Fernandez 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.
> 
> Do the examples included in rocaml work for you? In particular "oo", where an
> abstract type is used from Ruby, and "simple", which passes tuples to a
> function returning a tuple.

Yes; all the examples work fine.

The case that is failing is where I try to call functions in a .a created with
ocamlopt (it's an internal library written in Ocaml). I had to modify the
Makefile to add the .a to LOCAL_LIBS and surround it with -Wl,--whole-archive
.a -Wl,--no-whole-archive.  Without this option the resulting .so built by
rocaml would not have the Ruby-visible symbols (`KPP.make' in this case) and
the extension would fail with caml_named_value() returning NULL because the
named value would not be present.

> If you could pinpoint the conversion that's triggering the problem (and it's
> indeed a problem caused by a Ruby <-> OCaml conversion) we'd be one step
> away from fixing it.  Have you tried to disassemble the extension and see
> where caml_tuplify2 is being called?

I'll have a look. I do see references to caml_tuplify2 in other .a's as well.

Thanks for rocaml!

-- 
Jos Backus
jos at catnook.com