From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 4327A820A1 for ; Fri, 9 Aug 2013 14:14:01 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.89,845,1367964000"; d="scan'208";a="23599369" Received: from adijon-153-1-57-105.w81-51.abo.wanadoo.fr (HELO alcazar) ([81.51.200.105]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 09 Aug 2013 14:14:00 +0200 Date: Fri, 9 Aug 2013 14:13:46 +0200 From: Maxence Guesdon To: caml-list@inria.fr Message-ID: <20130809141346.6d240680@alcazar> In-Reply-To: <20130809114944.7111c7f5@alcazar> References: <20130809110908.0c2145c9@alcazar> <5204B5E7.9000409@glondu.net> <20130809113348.3a174c2f@alcazar> <5204B9D9.2060500@glondu.net> <20130809114944.7111c7f5@alcazar> Organization: INRIA X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Problem native dynlink loading cryptokit On Fri, 9 Aug 2013 11:49:44 +0200 Maxence Guesdon wrote: > On Fri, 09 Aug 2013 11:43:53 +0200 > St=C3=A9phane Glondu wrote: >=20 > > Le 09/08/2013 11:33, Maxence Guesdon a =C3=A9crit : > > >>> Here is a test program: > > >>> [...] > > >>> gives me the following error: > > >>> > > >>> Fatal error: exception Failure("error loading shared > > >>> library: /home/guesdon/.opam/4.00.1/lib/cryptokit/cryptokit.cmxs: > > >>> undefined symbol: caml_sha1_init") > > >>> > > >>> Am I doing something wrong ? Or is something missing in cryptokit > > >>> build ? > > >> > > >> It works for me (with system packages). > > >> > > >> caml_sha1_init should be in cryptokit.cmxs. The output of > > >> > > >> objdump -j .text -T /path/to/cryptokit.cmxs > > >> > > >> should contain all the C functions defined in cryptokit, plus some > > >> caml_curry* functions and camlCryptokit__* functions (compiled from > > >> OCaml). Is it true for you? > > >=20 > > > No, I only have camlCryptokit__sha1_init_3833 which I assume correspo= nds > > > to the function of src/cryptokit.ml: > > > external sha1_init: unit -> string =3D "caml_sha1_init" > >=20 > > Then, I suspect stubs were forgotten during the build of cryptokit.cmxs. > > In the output of: > >=20 > > ocamlobjinfo /path/to/cryptokit.cmxa > >=20 > > there should be the following lines: > >=20 > > Extra C object files: -lcryptokit_stubs -lz > > Extra C options: > >=20 > > Do you have the same lines? If so, maybe -linkall is missing in the call > > to ocamlopt -shared (the one that builds cryptokit.cmxs). >=20 > These lines are present in the .cmxa. But, sutdying the build commands, > the .cmxs is produced from cryptokit.cmx, not cryptokit.cmxa. Running > by hand=20 > # camlfind ocamlopt -shared -I src src/cryptokit.cmxa -linkall -o \ > src/cryptokit.cmxs For the records, as suggested by Sylvain Le Gall, adding use_libcryptokit_stubs in the _tags file to get: "src/cryptokit.cmxs": use_cryptokit, use_libcryptokit_stubs also produced a .cmxs file with the C part. - m