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:
Closed
Submitted by:
Jérôme Vouillon (vouillon)
Assigned to:
Sylvain Le Gall (gildor-admin)
Product:
OASIS
Due in version:
0.4.7
Resolution:
Fixed
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: 2016-04-02 23:16
Sender: Paul Snively

Hi everyone,

I think I've resolved this, with this patch against 0.4.5. I've lightly tested it by building and installing bin_prot on OCaml 4.02.3 on Mac OS X (with dynlink) and on ocaml-4.02.3-musl-static on Ubuntu trusty64 (no dynlink) after re-generating the build script with "oasis setup". I'd really like to learn of any other issues with this, get this patch integrated, get a new release of Oasis out, andd encourage Oasis users to regenerate their scripts so their packages can be built with ocaml-musl-static, i.e. what Go should have been.
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
status_idOpen2016-08-22 23:08gildor-admin
close_dateNone2016-08-22 23:08gildor-admin
assigned_tonone2016-08-22 23:08gildor-admin
ProductNone2016-08-09 00:36gildor-admin
Due in versionNone2016-08-09 00:36gildor-admin
ResolutionNone2016-08-09 00:36gildor-admin
File Added200: patch.txt2013-01-18 14:09vouillon