From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id EC530BBAF for ; Thu, 1 Jul 2010 21:01:50 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0BAESDLEzRVaE0mGdsb2JhbACDHZxFCBUBAQEBAQgJDAcRIq4sgkWFPIkBAQEDBYElgwlyBIgthyE X-IronPort-AV: E=Sophos;i="4.53,521,1272837600"; d="scan'208";a="53498196" Received: from mail-fx0-f52.google.com ([209.85.161.52]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Jul 2010 21:01:35 +0200 Received: by fxm8 with SMTP id 8so1858195fxm.39 for ; Thu, 01 Jul 2010 12:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=S3eU3pjpjF0ldFOXD4SyeVAUpJwFGWrOwj4sZWPH8MU=; b=T/nZTxDa2YYMqWgJl5KYfZGYK2TyXTFhuromx5TzlRSfPEAa9WDzm9AR2PkzIrhyVN E985f2hhwl/RhFDO4R1bXyM7yYaPO3qITcuW40SfQcsrJi/SVJYP6zyfZ7v/bW31ht7Q u+IcfOAPjQSA4iGlpZDPwjXMijpSFX4AYCgus= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=E6SzlkcYf7u5kfKlfQ2dXVIB63FLMaNwoylJNqvOQVEpfY7Kre7KCpXo+ZRhR52PWM 2CBuRpQ2Gr/jdi/nA5CL/w889XB+sR6EREiOFW5a8WYxFPe4ywmhmHKL8bXNkZ1usWpZ xCPPIeO0XU3W+U7Us+OgN3+tm/BGKV+gN26v0= MIME-Version: 1.0 Received: by 10.223.19.87 with SMTP id z23mr10031425faa.7.1278010894580; Thu, 01 Jul 2010 12:01:34 -0700 (PDT) Sender: daniel.c.buenzli@gmail.com Received: by 10.223.109.198 with HTTP; Thu, 1 Jul 2010 12:01:34 -0700 (PDT) Date: Thu, 1 Jul 2010 21:01:34 +0200 X-Google-Sender-Auth: NYt-TnzPB6m_uoGk8_cd9Cm-9gs Message-ID: Subject: Dynlinking plugins defining the same unit name but with different implementations. From: =?UTF-8?Q?Daniel_B=C3=BCnzli?= To: caml-list List Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; buenzli:01 ocaml:01 cmx:01 cmx:01 dynlink:01 loadfile:01 dynlink:01 loadfile:01 invocation:01 usr:01 ocamlopt:01 -shared:01 usr:01 ocamlopt:01 -shared:01 Hello, On osx 10.6.4 with ocaml 3.12.0+beta1 Suppose I have two following two plugins a.cmxs, containing a/a.cmx using M.test and a/m.cmx defining M.test b.cmxs, containing b/b.cmx using M.test and M.test2 and b/m.cmx defining M.test and M.test2 of course a/m.cmx and b/m.cmx are different implementations except they define the same interface for M.test If I Dynlink.loadfile or Dynlink.loadfile_private first a.cmxs and then b.cmxs there are no errors reported and b uses M.test of a/m.cmx but M.test2 of b/m.cmx (since the m.cmx in a.cmxs doesn't define it) Is that expected behaviour ? That looks like dll hell. Best, Daniel P.S. Here's how the plugins are constructed and an invocation of a test program to give an idea : > > ocamlbuild a.cmxs b.cmxs test.native > /usr/local/bin/ocamlopt.opt -shared a/m.cmx a/a.cmx -o a/a.cmxs > /usr/local/bin/ocamlopt.opt -shared b/m.cmx b/b.cmx -o b/b.cmxs > > ./test.native > A using M.test in a/m.ml > B using M.test in a/m.ml and M.test2 b/m.ml The last line should be > B using M.test in b/ml.ml and M.test2 b/m.ml or some kind of error should be reported.