With the 3.08 version of O’Caml, our project was able to create a MacOS X (darwin) shared library (dylib, not a bundle), by linking a mixture of O’Caml code, C object code, and all of the supporting O’Caml libraries. This allowed the users of our system to simply link to this one library to build a C application that uses our library’s C API. To do this, we linked in the O’Caml .a libraries and libasmrun.a.
With 3.09.1 this no longer works. The compiler complains that libasmrun.a has common symbols, which are incompatible with the creation of a dylib. I took a look at the configure script for ocaml 3.09.1 and see that for MacOS, the –fno-common flag is commented out of the configuration.
Is there a reason –fno-common was commented out?
Even if I fix this, I will eventually run into difficulties because we would have to require users of our C API to rebuild their OCaml with this change. Also, we are planning to use GODI to distribute our package, and can’t rely on the no-common version of OCaml being used to build our package.
Any suggestions?
Chris Rath
AT&T Labs Research