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=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id F3EF3BC69 for ; Thu, 2 Aug 2007 11:21:05 +0200 (CEST) Received: from ctsmtpout3.frontal.correo (smtp.telefonica.net [213.4.149.66]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l729L5Am006135 for ; Thu, 2 Aug 2007 11:21:05 +0200 Received: from tux-chan (83.32.14.179) by ctsmtpout3.frontal.correo (7.2.056.6) (authenticated as ferferse$telefonica.net) id 46AD035A0008FC24; Thu, 2 Aug 2007 11:20:52 +0200 Received: from batsman by tux-chan with local (Exim 3.36 #1 (Debian)) id 1IGWrT-00054p-00; Thu, 02 Aug 2007 11:20:51 +0200 Date: Thu, 2 Aug 2007 11:20:50 +0200 From: Mauricio Fernandez To: jos@catnook.com, caml-list@inria.fr Subject: Re: [Caml-list] undefined symbol `caml_tuplify2' in dynamic rocaml extension (UPDATE) Message-ID: <20070802092050.GC21868@tux-chan> Mail-Followup-To: jos@catnook.com, caml-list@inria.fr References: <20070801040102.GA88101@lizzy.catnook.local> <20070801091647.GB31718@tux-chan> <20070801161702.GA28680@lizzy.catnook.local> <20070801175907.GA29353@lizzy.catnook.local> <20070801232405.GB29353@lizzy.catnook.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070801232405.GB29353@lizzy.catnook.local> User-Agent: Mutt/1.5.11 Sender: =?iso-8859-1?Q?Mauricio_Julio_Fern=E1ndez_Pradier?= X-Miltered: at discorde with ID 46B1A201.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 ocaml:01 a's:01 libs:01 objs:01 libs:01 -output-obj:01 val:01 segfaults:01 compile-time:01 variants:01 makefile:01 wrappers:01 wrote:01 wrote:01 On Wed, Aug 01, 2007 at 04:24:05PM -0700, Jos Backus wrote: > On Wed, Aug 01, 2007 at 10:59:07AM -0700, Jos Backus wrote: > > On Wed, Aug 01, 2007 at 09:17:02AM -0700, Jos Backus wrote: > > > On Wed, Aug 01, 2007 at 11:16:47AM +0200, Mauricio Fernandez wrote: > > [snip] > > > > 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. > > > > It turns out my extension doesn't call it but one of the required libraries > > does. > > > > Here's what I am doing: > [snip] > > Some good news. We got this to work by creating a kpp.ml file (containing the > Callback.register calls) in the extension directory, and adding some values to > CAML_LIBS, CAML_OBJS and CAML_INCLUDES. Yay! Yes, I wrote a very long message telling you exactly this (that you needed to use CAML_LIBS so that -output-obj could work correctly) late at night but forgot to send it :) > It looks like we are really close. The next (final?) issue is that we have a > function with signature > > val eval : kpp -> string -> value list -> value list > > where > > type value = > | Vstr of string > | Vtup of value list > > which we want to export to Ruby. We tried: > > Interface.generate(EXT_NAME) do > value = sym_variant("value") do |t| > non_constant :Vstr, STRING > non_constant :Vtup, LIST(t) > end [...] > but it doesn't work (it segfaults inside the extension). > > How does one represent `value' on the Ruby side? I think you have to wrap the LIST(t) in a TUPLE(): value = sym_variant("value") do |t| non_constant :Vstr, STRING non_constant :Vtup, TUPLE(LIST(t)) end I'll try to either auto-detect this or perform a compile-time check. > Btw, besides having to remove the stray `"' we also found that we had to patch > the kpp_rocaml_wrapper.c to make it compile, basically doing a `%s/t_value > /t_value_/g' in this case. Chris Waterson has kindly sent me a patch fixing the problems you saw; I've just pushed it to the online repository, along with an example of the above TUPLE(LIST(t)) in examples/variants. I'll work on the INCFLAGS issue so there's no need to hand-edit the generated Makefile/wrappers. -- Mauricio Fernandez - http://eigenclass.org