caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: ikeda@msi.co.jp
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] How to create byte-code with static link
Date: Wed, 06 Nov 2002 18:03:28 +0900	[thread overview]
Message-ID: <20021106180328C.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <20021106162942Z.ikeda@msi.co.jp>

From: IKEDA Katsumi <ikeda@msi.co.jp>

> I make dllfoo.so libfoo.a from foo.c.
> Now I can create bar the following
> 
> ocamlc -o bar -dllpath /usr/local/foo/lib -I /usr/local/foo/lib foo.cma bar.cmo
> 
> There are dllfoo.so and libfoo.a in /usr/local/foo/lib
> 
> In this case, dllfoo.so is linked as dynamic link.

Not really linked: its name is just added to a table in your ocaml
bytecode. The system linker is not called.

> Is it possible link bar and libfoo.a as static link?

Yes, you just have to add the -custom flag.

  ocamlc -custom -o bar -I /usr/local/foo/lib foo.cma bar.cmo

By the way, ocamlopt always links in custom mode.
Note also that -custom is not equivalent to -ccopt -static: this one
is passed to the system linker, and is about whether to choose
libxxx.so or libxxx.a during a custom link (it does not affect
non-custom linkage).

---------------------------------------------------------------------------
Jacques Garrigue      Kyoto University     garrigue at kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-11-06  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06  7:29 IKEDA Katsumi
2002-11-06  9:03 ` Jacques Garrigue [this message]
2002-11-06  9:10   ` IKEDA Katsumi

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=20021106180328C.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=ikeda@msi.co.jp \
    /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).