<?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/11/fc711ff363ee98e5a52de94c646ee486"
  from="Mathieu Avila &lt;mavila@i...&gt;"
  author="Mathieu Avila"
  date="2003-11-04T13:52:10"
  subject="Re: [Caml-list] ocaml_startup et Solaris/x86"
  prev="2003/11/a5e3d51ebade36d6991bf4b045e55347"
  next="2003/11/fd0f1ccee25a666249fd8b99def103b8"
  prev-in-thread="2003/11/9caf042d7c5391a959764eb56c3450e0"
  next-in-thread="2003/11/1cd61c5f67a7aa90f725b489dbc1143b"
  prev-thread="2003/11/5ebcd6d0eea2cdbc8d8713f184910c24"
  next-thread="2003/11/96c5a045d70b126cf9ebbe6b346fc3dd"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] ocaml_startup et Solaris/x86">
<msg 
  url="2003/11/927fa5865c499289949ce45512930e10"
  from="Mathieu Avila &lt;mavila@i...&gt;"
  author="Mathieu Avila"
  date="2003-11-03T07:56:52"
  subject="[Caml-list] ocaml_startup et Solaris/x86">
<msg 
  url="2003/11/9caf042d7c5391a959764eb56c3450e0"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-11-04T01:09:10"
  subject="Re: [Caml-list] ocaml_startup et Solaris/x86">
<msg 
  url="2003/11/fc711ff363ee98e5a52de94c646ee486"
  from="Mathieu Avila &lt;mavila@i...&gt;"
  author="Mathieu Avila"
  date="2003-11-04T13:52:10"
  subject="Re: [Caml-list] ocaml_startup et Solaris/x86">
<msg 
  url="2003/11/1cd61c5f67a7aa90f725b489dbc1143b"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-11-05T02:18:41"
  subject="Re: [Caml-list] ocaml_startup et Solaris/x86">
<msg 
  url="2003/11/92b94daa2fb95ae6a57491d9c74ea2ef"
  from="Mathieu Avila &lt;mavila@i...&gt;"
  author="Mathieu Avila"
  date="2003-11-05T08:30:00"
  subject="Re: [Caml-list] ocaml_startup et Solaris/x86">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
Jacques Garrigue a écrit :

&gt;From: Mathieu Avila &lt;mavila@irisa.fr&gt;
&gt;
&gt;  
&gt;
&gt;&gt;I'd like to know whether there are known problems when mixing C and 
&gt;&gt;OCaml on the  Solaris/x86 platform.
&gt;&gt;The doc deals with particular flags to add for compiling on NT and 
&gt;&gt;Digital Unix on the Alpha, but there's nothing written for x86. I have a 
&gt;&gt;user of one of our tool written in Ocaml, who uses this platform and who 
&gt;&gt;informs us that the software crashes when it comes to call 
&gt;&gt;ocaml_startup, although everything goes right on solaris/sparc. Has this 
&gt;&gt;configuration been tested before ?
&gt;&gt;Thanks in advance !
&gt;&gt;    
&gt;&gt;
&gt;
&gt;I'm using ocaml on Solaris8/x86, and many C libraries, with no
&gt;problem.
&gt;
Are you able to call the ocaml code from the C ? I think this is rather 
different from calling C libs from a standalone OCaml code.
In my case, i mix the 2 langages in this way :

cmain.ml:
--------------------------------------------------------
let cmain_ocaml n = try
...
;;

let _ = Callback.register "cmain_ocaml" cmain_ocaml
--------------------------------------------------------

in a cmain_cpp.cpp , where there is the "real" main() function:
--------------------------------------------------------
 static value * cmain_closure = NULL;
 if (cmain_closure==NULL)
   cmain_closure = caml_named_value("cmain_ocaml");
 result = Int_val(callback(*cmain_closure,Val_int(n)));
--------------------------------------------------------

It crashses when calling :  callback(*cmain_closure...)

All is compiled into native solaris object code.
The same thing works perfectly on solaris/sparc.

--
Mathieu


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

