From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 6DFF7BB9A for ; Tue, 15 Nov 2005 05:23:51 +0100 (CET) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAF4NnvJ013734 for ; Tue, 15 Nov 2005 05:23:50 +0100 Received: from rosella (ppp7-104.lns1.syd7.internode.on.net [59.167.7.104]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id jAF4NhA4032044; Tue, 15 Nov 2005 14:53:44 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] ocamlc -output-obj problems From: skaller To: Jonathan Roewen Cc: caml-list@yquem.inria.fr In-Reply-To: References: Content-Type: text/plain Date: Tue, 15 Nov 2005 15:23:43 +1100 Message-Id: <1132028623.11813.99.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 437962D5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocamlc:01 -output-obj:01 ocamlc:01 -output-obj:01 interprete:01 globals:01 ocaml:01 libcamlrun:01 stub:01 ocaml:01 stubs:01 fprintf:01 initialise:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tue, 2005-11-15 at 16:52 +1300, Jonathan Roewen wrote: > Hi, > > I'm having serious problems with ocamlc -output-obj. > > It seems if I create a global variable, the interpreter won't run (it > gets into caml_interprete, but I don't know where it goes wrong once > in that function). > > Without any globals present, it runs fine. > The only custom parts in my ocaml environment are now just > libcamlrun.a, providing stub functions that return errors/raise > exceptions for functions I don't want/need to support. Maybe one of those is actually being used? Your basic argument is: (a) the make process works for normal Ocaml (b) you removed only unused functions from one library being linked in by stubbing them out (c) now it crashes ==> contradiation. Clearly the most likely is that (b) is wrong :) Trying changing the stubs to print a diagnostic .. though since the build isn't using standard libraries I don't know how you'd do that (you may need to use low level Unix calls like write instead of fprintf) Global variables typically need special handling.. since the idea is fundamentally flawed in the first place there is always going to be some crud to try to workaround the design fault. EG startup code to initialise some register to point to the global data frame. -- John Skaller Felix, successor to C++: http://felix.sf.net