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 96AC0820A1 for ; Fri, 9 Aug 2013 14:41:27 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of sylvain@le-gall.net) identity=pra; client-ip=80.91.229.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="sylvain@le-gall.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gclci-caml-list@m.gmane.org designates 80.91.229.3 as permitted sender) identity=mailfrom; client-ip=80.91.229.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="gclci-caml-list@m.gmane.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@plane.gmane.org designates 80.91.229.3 as permitted sender) identity=helo; client-ip=80.91.229.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="postmaster@plane.gmane.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoAAEXiBFJQW+UDmWdsb2JhbABBGoM7g2O8WBYOAQEBAQEICwsHFCiCJAEBBSMECwFWCxgCAiYCAhAsGxmIFAgyp0eRLoEojxCCUYEnA5kLkz0 X-IPAS-Result: ApoAAEXiBFJQW+UDmWdsb2JhbABBGoM7g2O8WBYOAQEBAQEICwsHFCiCJAEBBSMECwFWCxgCAiYCAhAsGxmIFAgyp0eRLoEojxCCUYEnA5kLkz0 X-IronPort-AV: E=Sophos;i="4.89,846,1367964000"; d="scan'208";a="23601448" Received: from plane.gmane.org ([80.91.229.3]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 09 Aug 2013 14:41:26 +0200 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V7m0T-00025F-5h for caml-list@inria.fr; Fri, 09 Aug 2013 14:41:25 +0200 Received: from root.ovh.le-gall.net ([37.59.37.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Aug 2013 14:41:25 +0200 Received: from sylvain by root.ovh.le-gall.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Aug 2013 14:41:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Date: Fri, 9 Aug 2013 12:41:09 +0000 (UTC) Message-ID: References: <20130809110908.0c2145c9@alcazar> <5204B5E7.9000409@glondu.net> <20130809113348.3a174c2f@alcazar> <5204B9D9.2060500@glondu.net> <20130809114944.7111c7f5@alcazar> <20130809141346.6d240680@alcazar> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: root.ovh.le-gall.net User-Agent: slrn/pre1.0.0-18 (Linux) Subject: [Caml-list] Re: Problem native dynlink loading cryptokit On 09-08-2013, Maxence Guesdon wrote: > On Fri, 9 Aug 2013 11:49:44 +0200 > Maxence Guesdon wrote: > >> On Fri, 09 Aug 2013 11:43:53 +0200 >> Stéphane Glondu wrote: >> >> > Le 09/08/2013 11:33, Maxence Guesdon a écrit : >> > >>> 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? >> > > >> > > No, I only have camlCryptokit__sha1_init_3833 which I assume corresponds >> > > to the function of src/cryptokit.ml: >> > > external sha1_init: unit -> string = "caml_sha1_init" >> > >> > Then, I suspect stubs were forgotten during the build of cryptokit.cmxs. >> > In the output of: >> > >> > ocamlobjinfo /path/to/cryptokit.cmxa >> > >> > there should be the following lines: >> > >> > Extra C object files: -lcryptokit_stubs -lz >> > Extra C options: >> > >> > Do you have the same lines? If so, maybe -linkall is missing in the call >> > to ocamlopt -shared (the one that builds cryptokit.cmxs). >> >> 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 >> # 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. > FTR, this is an OASIS bug: https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=1304&group_id=54&atid=291 It will be quickly fixed in cryptokit and later the fix will be included in OASIS itself so the next version of OASIS will fix this bug for all OASIS enabled packages. Cheers Sylvain -- Website: http://sylvain.le-gall.net/ OCaml forge: http://forge.ocamlcore.org OCaml blogs: http://planet.ocaml.org