caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: ygrek <ygrekheretix@gmail.com>
To: ben mailist <ben.mailist@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] creating a standalone labltk program
Date: Sat, 30 Jul 2011 13:35:18 +0300	[thread overview]
Message-ID: <20110730133518.798c6a30.ygrekheretix@gmail.com> (raw)
In-Reply-To: <CAHR=9vL2ZF1DkqVx3LJJBQ-7+=y63147X7k_KU0GC0H7jH4WGw@mail.gmail.com>

On Thu, 28 Jul 2011 14:43:58 +0200
ben mailist <ben.mailist@gmail.com> wrote:

> I try to staticall link all necessary libraries to create a standalone
> labltk application. So that it is no longer necessary to install the tcl/tk
> runtime on the target machine.
> [...]
>     $ ocamlopt -o lb -linkall  -I +labltk labltk.cmxa listbox01.ml

-linkall links in all ocaml modules, it has nothing to do with linking of external libraries.
In order to link everything statically you need to ask C linker to do so - the simplest way is
to use `-ccopt -static` but that means linking in libc which is not good usually. More involved and 
correct way is to wrap all external libraries with `-Wl,-Bstatic -lxxx -Wl,-Bdynamic` on command-line.
Note that using `ocamlopt -ccopt -Wl,-Bstatic <all arguments> -ccopt -Wl,-Bdynamic` (to wrap all libs
at once) will not usually work as ocamlopt reorders `-ccopt` at will :( Use `-verbose` to check what is
being passed to gcc.

-- 
 ygrek
 http://ygrek.org.ua

  reply	other threads:[~2011-07-30 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 12:43 ben mailist
2011-07-30 10:35 ` ygrek [this message]
2011-07-30 14:20 ` Jacques Garrigue

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=20110730133518.798c6a30.ygrekheretix@gmail.com \
    --to=ygrekheretix@gmail.com \
    --cc=ben.mailist@gmail.com \
    --cc=caml-list@inria.fr \
    /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).