Skip to content

Patch from PR6733 does not work on OS X #6927

@vicuna

Description

@vicuna

Original bug ID: 6927
Reporter: @whitequark
Assigned to: @whitequark
Status: resolved (set by @damiendoligez on 2017-02-24T12:07:38Z)
Resolution: suspended
Priority: normal
Severity: minor
OS: OS X
Version: 4.02.2
Target version: later
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Tags: patch
Related to: #6733
Monitored by: @gasche

Bug description

Amusingly, this is a case of doing more work than necessary and failing at it, because the linker invocation already includes the -shared/-bundle flag, added by the compiler driver (ocamlc/ocamlopt). On Linux the second instance of -shared, added by the flag ["ocaml"; "link"; "output_shared"] built-in rule, is ignored, but on OS X it conflicts with -bundle.

A patch is attached. I verified that it works on Linux and OS X. It probably also works on Windows, since now output_so includes no platform details not used in the compiler elsewhere, but I'm not sure. Flexlink might or might not be a problem for the 3rd party code that wishes to load the resulting DLLs.

Additional information

The target is a bundle, but it is called x.{byte,native}.so. This is actually common practice, and there is no generally agreed upon file extension for bundles (although .bundle is often used), but ocamlbuild rules mention .dylib, which does not actually happen. A second patch is attached to alleviate that.

File attachments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions