OCaml Forge

Detail: [#1251] The OCamlbuild plugin assumes that dynamic linking is supported.

Bugs: Browse | Download .csv | Monitor

[#1251] The OCamlbuild plugin assumes that dynamic linking is supported.

Date:
2013-01-18 14:09
Priority:
3
State:
Open
Submitted by:
Jérôme Vouillon (vouillon)
Assigned to:
Nobody (None)
Product:
None
Due in version:
None
Resolution:
None
Severity:
None
Version:
None
Component:
Plugin OCamlbuild
Operating System:
None
 
URL:
Summary:
The OCamlbuild plugin assumes that dynamic linking is supported.

Detailed description
Cross compilers cannot support dynamic linking as ocamlc needs to load the shared library when linking to find C symbols.

However, the OCamlbuild plugin systematically requests the compilation of shared libraries dll%s_stubs.dll.

The current work-around is to pretend that dynamic linking is supported: shared libraries are produced by ocamlmklib, but they cannot be used, and ocamlc has to be invoked with the "-custom" option when linking.

The fix might be simply to not ever request the compilation of shared libraries dll%s_stubs.dll (see attached patch). When dynamic linking is supported, ocamlmklib will produce them anyway.

Followup

Message
Date: 2013-01-21 14:30
Sender: Jérôme Vouillon

In fact, that's not so simple...

First, there are several mentions of shared libraries in the Oasis source code, and the patch does not seem to remove the right one.

Second, we don't need to explicitly request the C share libraries to be built, but we must tell ocamlfind to install them when they are there. There does not seem to be any easy way to tell whether shared libraries, so the simplest thing to do might be to look in the filesystem whether they have been build. Or one can use the -optional flag of ocamlfind and let ocamlfind handle the issue.

I don't understand the Oasis source code well enough to provide a patch.

Attached Files:

Attachments:
patch.txt

Changes:

Field Old Value Date By
File Added200: patch.txt2013-01-18 14:09vouillon