<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/d4af9359cdc183f21897cd610a09561c"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-07-29T16:28:46"
  subject="Re: [Caml-list] Dynlink problems"
  prev="2003/07/24e15096f082fa3a4284ba146728d8c5"
  next="2003/07/82b3d5d0d35fae3d00bd39fcde421760"
  prev-in-thread="2003/07/6ffbb61144ba7f83cf04a524a7aabde8"
  next-in-thread="2003/07/90829853dc49798bf101a9cfeb7983e1"
  prev-thread="2003/07/61117640c01e53ce9c5abd6333cd32b3"
  next-thread="2003/07/8d067f3472c9db2843900ad04bc1ddfd"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Dynlink problems">
<msg 
  url="2003/07/976c83213750a167f0a635b7687ffe81"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-07-28T09:49:21"
  subject="[Caml-list] Dynlink problems">
<msg 
  url="2003/07/9a64ca5030c2ffb1a7eff3aa619c37e1"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-07-28T10:07:36"
  subject="Re: [Caml-list] Dynlink problems">
</msg>
<msg 
  url="2003/07/ab88f0ef9aad4a672172cac3798039fb"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-07-28T10:22:20"
  subject="Re: [Caml-list] Dynlink problems">
<msg 
  url="2003/07/01ec52a086a48ba9f37cf34e09d2a702"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-07-28T17:41:56"
  subject="Re: [Caml-list] Dynlink problems">
<msg 
  url="2003/07/9e1cdbeb2581b104e19c252cae4b4b29"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-07-29T08:48:00"
  subject="Re: [Caml-list] Dynlink problems">
<msg 
  url="2003/07/6ffbb61144ba7f83cf04a524a7aabde8"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-07-29T15:43:56"
  subject="Re: [Caml-list] Dynlink problems">
<msg 
  url="2003/07/d4af9359cdc183f21897cd610a09561c"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-07-29T16:28:46"
  subject="Re: [Caml-list] Dynlink problems">
<msg 
  url="2003/07/90829853dc49798bf101a9cfeb7983e1"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-07-31T17:31:58"
  subject="Re: [Caml-list] Dynlink problems">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
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        &lt;-- 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?

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - 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. http://www.annexia.org/freeware/makeplus/

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

</contents>

</message>

