Skip to content

Conversation

@fpottier
Copy link
Contributor

This should allow CompCert to compile with Menhir 20200123 and newer.

@bschommer
Copy link
Member

Indeed that should work, however this is not really backward compatible, since older menhir versions did not install the .cmxa file as far as I know.

@fpottier
Copy link
Contributor Author

Hi Bernhard, you are correct, older versions of Menhir installed menhirLib.{cmi,cmo,cmx,cmxs,o} whereas the new version installs menhirLib.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs}. The old set of files was hardcoded somewhere in our Makefiles, whereas the new set of files is automatically chosen by dune and/or opam.

I suppose you could complicate Makefile.menhir by testing which of menhirLib.cmx and menhirLib.cmxa exists. This would allow to preserve compatibility between a new CompCert and an old Menhir. But it may be simpler to just require a newer Menhir. (Also, the compatibility between an old CompCert and a new Menhir will remain broken, unless you apply the patch retroactively.)

xavierleroy added a commit that referenced this pull request Jan 30, 2020
Since Menhir version 20200123, we need to link with menhirLib.cmxa
instead of menhirLib.cmx.

This commit chooses automatically the file to link with:
menhirLib.cmxa if it exists in the menhirLib installation directory,
menhirLib.cmx otherwise.

To reliably find the installation directory, configure was changed
to record the menhirLib directory in Makefile.config, variable MENHIR_DIR,
instead of a pre-cooked command-line option MENHIR_INCLUDES.

Makefile.extr was adapted accordingly.

Fixes: #329
Closes: #330
@xavierleroy
Copy link
Contributor

I suppose you could complicate Makefile.menhir by testing which of menhirLib.cmx and menhirLib.cmxa exists. This would allow to preserve compatibility between a new CompCert and an old Menhir.

See #331 for an implementation of this idea. It might be worth preserving compatibility for a few versions of CompCert.

@xavierleroy
Copy link
Contributor

We went with the more convoluted fix at #331. Thanks for having diagnosed the issue, anyway.

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.

3 participants