Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Dynlink problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-29 (16:28)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Dynlink problems
Further investigations ... I'm calling caml_startup which appears to
call this function:

CAMLexport void caml_startup_code(code_t code, asize_t code_size,
                                  char *data, char **argv)
  // ...
  sys_init("", argv);
  // ...

The first argument to sys_init causes Sys.executable_name to be set to
"", which means that Dynlink.init fails here:

(* Initialize the linker for toplevel use *)

let init_toplevel () =
  (* Read back the known global symbols and the known primitives
     from the executable file *)
  let ic = open_in_bin Sys.executable_name in        <-- failure happens here

This looks like a bug in the case where we need to use Dynlink from a
shared library (.so file).

Note that the code expects to find a bytecode executable, not a native
binary or .so file, but of course I'm trying to run all of this from a
shared library embedded in a C program. There's simply no bytecode
executable around to look at.

What should I do?


Richard Jones.
Merjis Ltd. - all your business data are belong to you.
MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles,
RPMs, pkgs etc. Linux, BSD, Solaris.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: