From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA06619; Thu, 10 Oct 2002 18:53:07 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA06415 for ; Thu, 10 Oct 2002 18:53:06 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from vendian.org (ediacara.ne.client2.attbi.com [24.128.96.133]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9AGr5D03506 for ; Thu, 10 Oct 2002 18:53:05 +0200 (MET DST) Received: (from mcharity@localhost) by vendian.org (8.11.6/8.11.6) id g9AGt5118720; Thu, 10 Oct 2002 12:55:05 -0400 Date: Thu, 10 Oct 2002 12:55:05 -0400 Message-Id: <200210101655.g9AGt5118720@vendian.org> To: caml-list@inria.fr Subject: [Caml-list] Suggest ocamlopt's -dstartup place file locally, like -S does. From: Mitchell N Charity Reply-to: mcharity@vendian.org Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I am using ocamlopt to generate object files which can be loaded by _non_ ocaml processes. So I compile the code with -c. And then link against libasmrun.a, std_exit.o, and stdlib.a. And the .a versions of any .cmxa's used. This is not exactly convenient, but is not a big deal. However, the final component, camlstartupXXXX.s, is a problem. One creates it by running ocamlopt with the undocumented argument -dstartup, which says "do not delete camlstartupXXXX.s after compilation". Which is fine. I just throw away the resulting standalone executable. But where does ocamlopt leave the camlstartup file? In the current directory like -S does? No. The file is left in /tmp . With a semi-random name. So after running ocamlopt, my program has to grovel through /tmp looking for camlstartupXXXX.s files. And then find the one that resulted from the current compilation (it adds a randomly named symbol to the source). This is a horrible kludge. Which wouldn't be necessary if -dstartup, rather than just preventing the deletion of the file in /tmp, instead also placed the file someplace convenient. Like "a.out.s". Or wherever. Why don't I just edit asmcomp/asmlink.ml myself? Because my application is intended to work with unmodified ocaml installations. (It's a Perl Inline module, Inline::OCamlOpt. Which allows you to include ML code in perl source files, with glue code generation, cached compilation, and linking, all handled automagically. Thus one can use ML, without the cliff-face learning curve of having to code the entire application in ML. It's a two-evening hack, but I'm already finding it useful.) So I suggest -dstartup's behavior be slightly modified. Though my ML is rusty, I'll do a patch if that would help. Thank you for your work, Mitchell Charity ------------------- 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