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.1 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 83EA1BBC4 for ; Tue, 31 Mar 2009 18:34:15 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlIEAJzi0UnB/BYdaWdsb2JhbACWAw0LAwUJEQO3a4N6Bg X-IronPort-AV: E=Sophos;i="4.38,453,1233529200"; d="scan'208";a="37588493" Received: from smtp20.orange.fr ([193.252.22.29]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Mar 2009 18:34:15 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2016.orange.fr (SMTP Server) with ESMTP id BAF0E20000B5; Tue, 31 Mar 2009 18:34:14 +0200 (CEST) Received: from [192.168.1.66] (APuteaux-154-1-7-74.w83-199.abo.wanadoo.fr [83.199.4.74]) by mwinf2016.orange.fr (SMTP Server) with ESMTP id 7953420000B4; Tue, 31 Mar 2009 18:34:14 +0200 (CEST) X-ME-UUID: 20090331163414497.7953420000B4@mwinf2016.orange.fr Message-ID: <49D24603.7060509@frisch.fr> Date: Tue, 31 Mar 2009 18:34:11 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Pierre-Lo=EFc_Garoche?= Cc: caml-list@yquem.inria.fr, thirioux@enseeiht.fr Subject: Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ? References: <49D243B0.6020103@onera.fr> In-Reply-To: <49D243B0.6020103@onera.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; frisch:01 frisch:01 librairies:01 cmx:01 cmxa:01 ocamlopt:01 -shared:01 ocamlopt:01 -shared:01 mylib:01 cmxa:01 cmx:01 -linkall:01 mylib:01 -linkall:01 Pierre-Loïc Garoche wrote: > ** First: what about external libraries ? > Could you detail the behavior of the linking process of cmxs file with > respect to dependancies. > > If I understand well any library used to compile cmx files should be > - either know by the software dynamically loading the plugin, > - or its cmxa should be passed as argument of ocamlopt -shared command. > > But what is the difference between: > ocamlopt.opt -shared mylib.cmxa xxx.cmx yyy.cmx -o target.cmxs > and > ocamlopt.opt -shared -linkall mylib.cmxa xxx.cmx yyy.cmx -o target.cmxs > > Both seems to work similarly on my example (no differences between > resulting files). The -linkall forces all the modules in the included libraries (here, mylib.cmxa) to be included in the .cmxs file, even if they are not explicitly used by other linked modules. This option is generally useless when linking cmxs files, unless the .cmxs file is loaded in non-private mode, and you want subsequently loaded .cmxs files to be able to access any module in the libraries. (Typically, if you turn mylib.cmxa into a mylib.cmxs, without any other module, you want -linkall.) > ** Second: how about packs ? As far as I can tell, packing and creating cmxs files are orthogonal features: they don't overlap and they don't have bad interactions. It is ok to put in cmxs files a module produced by -pack. I think it is also ok to put modules compiled with -for-pack, but I don't see why you would do that. Regards, Alain