From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA30068 for caml-red; Thu, 23 Nov 2000 13:49:33 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA30531 for ; Thu, 23 Nov 2000 13:47:57 +0100 (MET) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.6.1]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eANClv113626; Thu, 23 Nov 2000 13:47:57 +0100 (MET) Received: from lambda.u-strasbg.fr (lambda.u-strasbg.fr [130.79.90.63]) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) with ESMTP id OAA08714; Thu, 23 Nov 2000 14:47:54 +0100 Received: from luther by lambda.u-strasbg.fr with local (Exim 3.16 #1 (Debian)) id 13yvvO-00055C-00; Thu, 23 Nov 2000 13:56:26 +0100 Date: Thu, 23 Nov 2000 13:56:25 +0100 To: Xavier Leroy Cc: Steve Stevenson , caml-list@inria.fr Subject: Re: Missing something in getting C and Ocaml to Work Together Message-ID: <20001123135625.A19531@lambda.u-strasbg.fr> References: <14873.37069.529974.959686@merlin.cs.clemson.edu> <20001122212917.A17173@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001122212917.A17173@pauillac.inria.fr>; from Xavier.Leroy@inria.fr on Wed, Nov 22, 2000 at 09:29:17PM +0100 From: Sven LUTHER Sender: weis@pauillac.inria.fr On Wed, Nov 22, 2000 at 09:29:17PM +0100, Xavier Leroy wrote: > > I have a very simple application. I have the main in ocaml and > > the rest of the system in C. I'm just trying something very straight > > forward. > > [...] > > ocamlc main.cmo -custom -cclib csrc/libmainc.a > > When I do, I get no errors but > > ocamlrun a.out > > produces > > Fatal error: this bytecode file cannot run on this bytecode interpreter > > Mismatch on primitive `cmainarg' > > Just run a.out directly, as in "./a.out". The -custom flag to ocamlc > causes it to produce a "mixed" executable containing both OCaml > bytecode and a specially tailored bytecode interpreter that includes > your C code. > > Using the standard "ocamlrun" bytecode interpreter on such an > executable fails, because ocamlrun doesn't contain the C functions that > the bytecode part of the mixed executable calls ("cmainarg" here). Any news on arch independent cutsom code you spoke about some time ago ? Friendly, Sven Luther