Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMake plugin has a bogus cmxs rule #134

Closed
ivg opened this issue Dec 13, 2019 · 0 comments · Fixed by #137
Closed

OMake plugin has a bogus cmxs rule #134

ivg opened this issue Dec 13, 2019 · 0 comments · Fixed by #137

Comments

@ivg
Copy link
Member

ivg commented Dec 13, 2019

The rule to build the %.cmxs files

    $(CMXSFILE): $(NATIVELIB) $(CLIB)
        $(OCAMLOPTLINK) -shared -cclib -L. -o $(CMXSFILE) $(NATIVELIB)

However, when cmxa is used, ocamlopt will only link those modules that are used. Since there are no other input files, the produced file is empty and totally useless.

Proposed solutions

  1. Passing the -linkall option will resolve this issue and the cmxs file will have the same units as the cmxa file.

  2. Alternatively, the cmxa file could be defined the same as cmxa rule, i.e., to build the output from the cmx files (and ofiles).

The former solution is easier to implement, the latter provides more opportunities for parallelization (cmxs and cmxa could be built in parallel), but at the cost of slightly more complex rule.

I can PRovide either solution so if you have any preferences I'm interested to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant