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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 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 068B7BBAF for ; Mon, 5 Oct 2009 15:31:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisCAHuRyUrU4367lGdsb2JhbACBUpklAQEBAQkLCAkTA7ZKAoQoBIFS X-IronPort-AV: E=Sophos;i="4.44,505,1249250400"; d="scan'208";a="35689232" Received: from moutng.kundenserver.de ([212.227.126.187]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Oct 2009 15:31:14 +0200 Received: from office1.lan.sumadev.de (dslb-094-219-220-178.pools.arcor-ip.net [94.219.220.178]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0Me7T8-1MgyJ40L4I-00QFbs; Mon, 05 Oct 2009 15:31:13 +0200 Received: from [192.168.0.32] (dslb-084-058-008-239.pools.arcor-ip.net [84.58.8.239]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 96D77C0EA5; Mon, 5 Oct 2009 15:31:11 +0200 (CEST) Subject: Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11? From: Gerd Stolpmann To: Conglun Yao Cc: Richard Jones , caml-list@yquem.inria.fr In-Reply-To: References: <20091004190509.GA31372@annexia.org> <20091004193740.GB28561@annexia.org> Content-Type: text/plain Date: Mon, 05 Oct 2009 15:35:54 +0200 Message-Id: <1254749754.1870.12.camel@flake.lan.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18t6S1CcyKL64CVuges4G+O8p/yqtWUsQPXGUY +gGa02X0GE7LlfN+OZCq9ORdpXndNgaX5lzCH4erw2NHQjmvng j4crrVmoxl8+TpSCo3HPw== X-Spam: no; 0.00; dynlink:01 ocamlfind:01 camlp:01 gerd:01 stolpmann:01 gerd:01 dynlink:01 ocamlfind:01 ocamlc:01 -package:01 ocamlc:01 -package:01 camlp:01 lib:01 ocaml:01 Am Sonntag, den 04.10.2009, 20:53 +0100 schrieb Conglun Yao: > > > > > In that case, try listing dynlink explicitly, like: > > ocamlfind ocamlc dynlink.cma -package json-static [etc] > > $ ocamlfind ocamlc dynlink.cma -package json-static -syntax camlp4o -c > test.ml > > $ ocamlfind ocamlc -I /home/conglun/godi/lib/ocaml/pkg-lib/camlp4 > dynlink.cma -package json-static -syntax camlp4o -c t.ml > > > Error: Error while > linking /home/conglun/godi/lib/ocaml/std-lib/camlp4/camlp4lib.cma(Camlp4): > Reference to undefined global `Dynlink' > > > > Anyhow, it sounds like a bug in the META files that are > supplied with > your cygwin OCaml distribution. > > > > > I think you are right, the problem happens on the camlp4o or cygwin, > which can't load dynlink. But I can't find problem in the camlp4's > META (in the attachment) While cygwin cannot load shared libraries from bytecode, it still can load pure bytecode dynamically. It is reasonable that there is a dynlink.cma for this case, and that camlp4lib.cma depends on it. findlib has a special mode for platforms that cannot load shared libraries dynamically. This mode seems to be broken - it calls a script safe_camlp4 instead of camlp4, and safe_camlp4 produces ad hoc a new camlp4-type executable that includes the required C libraries - without that trick you couldn't use json-static at all on these platforms: https://godirepo.camlcity.org/svn/lib-findlib/trunk/tools/safe_camlp4 The question is now whether the error is in this script (does it have to add dynlink.cma anyway?) or whether mkcamlp4 is broken. Can you try to change safe_camlp4 so the line mkcamlp4 -o $tmp_camlp4 $cp4_mods || exit reads mkcamlp4 -o $tmp_camlp4 dynlink.cma $cp4_mods || exit ? (I don't have a cygwin ocaml at hand.) safe_camlp4 should be in the bin/ directory. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------