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.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id D8431BC69 for ; Wed, 1 Aug 2007 15:58:39 +0200 (CEST) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.185]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l71Dwcqg011291 for ; Wed, 1 Aug 2007 15:58:39 +0200 Received: from mac.com (smtpin06-en2 [10.13.10.151]) by smtpout.mac.com (Xserve/smtpout15/MantshX 4.0) with ESMTP id l71DwbaC009326; Wed, 1 Aug 2007 06:58:37 -0700 (PDT) Received: from [10.0.1.101] (c-24-218-151-219.hsd1.ma.comcast.net [24.218.151.219]) (authenticated bits=0) by mac.com (Xserve/smtpin06/MantshX 4.0) with ESMTP id l71DwYS5029601 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 1 Aug 2007 06:58:36 -0700 (PDT) In-Reply-To: <20070801074422.GA5362@jiyu.gnu> References: <20070801040102.GA88101@lizzy.catnook.local> <20070801074422.GA5362@jiyu.gnu> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Message-Id: <16ACAC9F-6006-42A1-85A4-7AAC218F6749@mac.com> Cc: Jos Backus , caml-list@inria.fr Content-Transfer-Encoding: quoted-printable From: Gordon Henriksen Subject: Re: [Caml-list] undefined symbol `caml_tuplify2' in dynamic rocaml extension Date: Wed, 1 Aug 2007 09:59:22 -0400 To: Julien Moutinho X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== X-Brightmail-scanned: yes X-Miltered: at discorde with ID 46B0918E.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 patched:01 ocamlopt:01 -output-obj:01 ocamlopt:01 compiler:01 2007,:98 wrote:01 wrote:01 emit:01 caml-list:01 functions:01 undefined:01 undefined:01 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 =20= >> accessed from a dynamic Ruby extension (using Callback.register). =20 >> Everything works, except when I try to access the Ocaml type from =20 >> 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 =20 >> symbol? It doesn't appear in any library. ocaml version is 3.09.2. > > AFAICS, when needed, caml_tuplifyN end up within the /tmp/=20 > camlstartup*.s file mechanically generated at link time. You can =20 > keep this file with -dstartup. > > Unfortunately, due to its quasi-random name, it is not easy to =20 > retrieve it mechanically. > > Personally I have patched ocamlopt in order to have a -startup =20 > option keeping camlstartup_.o in the current =20 > directory. > > Anyway, maybe there is a better way for your own concern. Have a =20 > glance at -output-obj perhaps. > > HTH. I wonder if there's a reason ocamlopt doesn't simply emit these glue =20 functions alongside their uses as linkonce symbols. This is the same =20 technique that a C++ compiler uses for template instantiations to =20 avoid problems of this nature. =97 Gordon