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

New dunification of Zarith #2

Draft
wants to merge 11 commits into
base: duniverse-new-master
Choose a base branch
from

Conversation

TheLortex
Copy link
Member

This PR is a new proposal for the dunification of Zarith, based on the latest changes on Zarith's upstream.
Thanks to ocaml#94, the dune switch becomes much simpler.

This port has two goals:

  1. add support for cross-compilation through custom dune workspaces: this is done by using a dune port of the gmp library https://github.com/mirage/ocaml-gmp, so that when it's vendored, gmp is cross-compiled using workspace flags and cc.
  2. keep support for using the system gmp when it's available (through conf-gmp opam package). This allows to use zarith for building host binaries without having to rebuild gmp.

(1) is implemented with the three first commits. (2) is achieved through the last commit, which adds some complexity to choose between conf-gmp (system gmp) and gmp (self built gmp).

I also added end-to-end tests, both for the host system and a cross-compiled setup (with solo5/ocaml-freestanding).

This is not to merge right now, it depends on:

@avsm
Copy link

avsm commented Feb 18, 2021

Generally looks good. Would it be possible to wrap the upstream ./configure invocation in the dune file, rather than the manual shell invocations? Ideally the ./configure script should be the canonical way by which the dune cross-compilation is configured.

@TheLortex
Copy link
Member Author

I can try to do that but the configure script is not cross-compilation ready, it's looking for a global ocamlc to generate the configuration. I'll look into that !

@TheLortex
Copy link
Member Author

@avsm Updated the PR: I wrapped the configure script, using env variables to control ./configure's behavior. Shell commands are needed to extract LIBS and CFLAGS from the generated Makefile. What do you think ?

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 this pull request may close these issues.

2 participants