Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000054OCaml~DO NOT USE (was: OCaml general)public2000-03-11 23:482004-04-18 16:38
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000054: Dynlink and -output-obj do not work together
DescriptionFull_Name: Gerd Stolpmann
Version: 2.04
Submission from: (


I have a OCaml program which is embedded in another (C) program; I did
this by using the -output-obj option of the (bytecode) compiler. This
alone works fine; but if I try to initialize the Dynlink library (calling
Dynlink.init), the runtime system wants to read the bytecode executable
again to get the symbol table. The code in Symtable.init_toplevel reads
the file in argv.(0) and interprets it as bytecode executable. Of course,
in my program it is impossible to read such an executable because there
is not any.

I use currently a hack to get around this limitation: I wrote a shell script
that outputs the list of primitives to stdout; I built a "pseudo executable"
using ocamlc -use-runtime /name/of/shellscript. That way, the produced bytecode
should be identical, and the executable contains a symbol table. Finally,
I set Sys.argv.(0) to the path of the pseudo executable before invoking

I think it is much better to repair the runtime system; the -output-obj
option could also force the compiler to put a symbol table into the generated
object file, and Dynlink.init should be able to read this symbol table.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2004-04-18 16:38

Wish granted (at last!) 2004/02/22 by XL

- Issue History
Date Modified Username Field Change
2005-11-18 10:14 administrator New Issue
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker