caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] How to create byte-code with static link
@ 2002-11-06  7:29 IKEDA Katsumi
  2002-11-06  9:03 ` Jacques Garrigue
  0 siblings, 1 reply; 3+ messages in thread
From: IKEDA Katsumi @ 2002-11-06  7:29 UTC (permalink / raw)
  To: caml-list

Hi,

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.

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

Thanks.

-- 
IKEDA Katsumi  <ikeda@msi.co.jp>
-------------------
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] How to create byte-code with static link
  2002-11-06  7:29 [Caml-list] How to create byte-code with static link IKEDA Katsumi
@ 2002-11-06  9:03 ` Jacques Garrigue
  2002-11-06  9:10   ` IKEDA Katsumi
  0 siblings, 1 reply; 3+ messages in thread
From: Jacques Garrigue @ 2002-11-06  9:03 UTC (permalink / raw)
  To: ikeda; +Cc: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] How to create byte-code with static link
  2002-11-06  9:03 ` Jacques Garrigue
@ 2002-11-06  9:10   ` IKEDA Katsumi
  0 siblings, 0 replies; 3+ messages in thread
From: IKEDA Katsumi @ 2002-11-06  9:10 UTC (permalink / raw)
  To: caml-list

Hi,

From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
Message-ID: <20021106180328C.garrigue@kurims.kyoto-u.ac.jp>
> From: IKEDA Katsumi <ikeda@msi.co.jp>
> > 
> > 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.

I understand.


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

OK, I will try it.


> By the way, ocamlopt always links in custom mode.

Thanks,

-- 
IKEDA Katsumi  <ikeda@msi.co.jp>
-------------------
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-06  9:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06  7:29 [Caml-list] How to create byte-code with static link IKEDA Katsumi
2002-11-06  9:03 ` Jacques Garrigue
2002-11-06  9:10   ` IKEDA Katsumi

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