Browse thread
[Caml-list] ocamlc -output-obj problems
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2005-11-15 (04:23) |
From: | skaller <skaller@u...> |
Subject: | Re: [Caml-list] ocamlc -output-obj problems |
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 <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net