caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <gerd@gerd-stolpmann.de>
To: Conglun Yao <yaoconglun@gmail.com>
Cc: Richard Jones <rich@annexia.org>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?
Date: Mon, 05 Oct 2009 15:35:54 +0200	[thread overview]
Message-ID: <1254749754.1870.12.camel@flake.lan.gerd-stolpmann.de> (raw)
In-Reply-To: <f7b50d2a0910041253k4b33e67cvf8190197c2cbc50e@mail.gmail.com>


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
------------------------------------------------------------


  parent reply	other threads:[~2009-10-05 13:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-04 14:22 Conglun Yao
2009-10-04 14:24 ` Conglun Yao
2009-10-04 19:05 ` [Caml-list] " Richard Jones
2009-10-04 19:32   ` Conglun Yao
2009-10-04 19:37     ` Richard Jones
2009-10-04 19:53       ` Conglun Yao
2009-10-04 20:06         ` Conglun Yao
2009-10-04 20:33         ` Richard Jones
2009-10-04 20:35           ` Richard Jones
2009-10-04 21:14             ` David Allsopp
2009-10-04 21:40               ` Conglun Yao
2009-10-05  7:39                 ` David Allsopp
2009-10-05 10:14                   ` Conglun Yao
2009-10-05 13:35         ` Gerd Stolpmann [this message]
2009-10-05 15:17           ` Conglun Yao
2009-10-05 17:28             ` David Allsopp
2009-10-05 17:55           ` Alain Frisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254749754.1870.12.camel@flake.lan.gerd-stolpmann.de \
    --to=gerd@gerd-stolpmann.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=rich@annexia.org \
    --cc=yaoconglun@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).