From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id EF603BC69 for ; Wed, 1 Aug 2007 18:16:47 +0200 (CEST) Received: from lizzy.dyndns.org (209-204-188-132.dsl.static.sonic.net [209.204.188.132]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l71GGiLe008802 for ; Wed, 1 Aug 2007 18:16:46 +0200 Received: (qmail 28764 invoked by uid 1000); 1 Aug 2007 16:17:02 -0000 Date: Wed, 1 Aug 2007 09:17:02 -0700 From: Jos Backus To: caml-list@inria.fr Subject: Re: [Caml-list] undefined symbol `caml_tuplify2' in dynamic rocaml extension Message-ID: <20070801161702.GA28680@lizzy.catnook.local> Reply-To: jos@catnook.com References: <20070801040102.GA88101@lizzy.catnook.local> <20070801091647.GB31718@tux-chan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070801091647.GB31718@tux-chan> User-Agent: Mutt/1.5.16 (2007-06-09) X-Miltered: at concorde with ID 46B0B1EC.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 ocaml:01 ocaml:01 ocamlopt:01 makefile:01 libs:01 -wl:01 -wl:01 a's:01 wrote:01 wrote:01 abstract:01 caml-list:01 functions:01 tuples:01 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