-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support OCaml 5.3.0 #148
Open
shym
wants to merge
12
commits into
mirage:main
Choose a base branch
from
shym:530
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support OCaml 5.3.0 #148
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rename the examples, so that there are no longer `main.xyz.ml`, just `xyz.ml` Extract the common C modules into a library so that all the tests can be compiled (and executed) in one run of `dune` Set up a `dune_gen` to avoid the boilerplate of all the options (in particular since putting the manifest in a library requires an explicit option to link it in)
Those patches are extracted from (only keeping what is relevant for OCaml/Solo5): - PR 13526 (merged upstream) (10 commits) - PR 13674 (merged upstream) (1 commit) - PR 13719 (merged upstream) (1 commit) - PR 13735 (under review) (3 commits) - a not-opened-yet PR to support freestanding targets (2 commits) - plus a not-to-be-upstreamed commit to fix the maximum number of domains to 1
Since PR 13526, the OCaml compiler comes with specific rules to build and install a cross compiler so rely on them rather than `ocaml-solo5`-specific workarounds Use opam’s ability to install both what is registered in a .install file and run the `install` commands to combine OCaml’s install rule with a `.install` file for other files (`nolibc` and `openlibm` libraries, `ocamlfind` files and the toolchain)
Those functions are necessary only to compile the bytecode part of the OCaml compiler so they won’t be called
Follow the `ocamlfind` configuration for the standard OCaml compiler by adding the compiler’s directory at the beginning of the configuration `path` variable, so that OCaml-provided `META` files can be found by `ocamlfind` Remove the, now useless, dummy file that was created to ensure `threads` could be found This makes it possible to find not only `threads` but also all the other OCaml-provided libraries, such as `compiler-libs`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the supported OCaml version with 5.3.0. This PR sits at the moment on top of #147 in order to illustrate with the new examples at least some of new possibilities of that version.
Most of the patches that are required for the compiler have been accepted upstream (so to be part of 5.4) and are therefore backported here. As the patches that we have in
main
for 5.2.1 are slightly incompatible (they were drafts for the patches that got upstreamed), they would need to be reworked for our mainMakefile
to support both versions. As 5.2.1 was still considered experimental, this PR proposes to simply support 5.3.0.The main part of this PR then is the set of patches for 5.3.0. Those patches are extracted from upstream PRs (selecting the commits that are relevant for OCaml/Solo5):
Note that since upstream PR 13272, the maximum number of domains can be set using a parameter in
OCAMLRUNPARAM
so I tried to replace that last patch by adding tonolibc
asecure_getenv
returning"d=1"
for theOCAMLRUNPARAM
value. But that value is then parsed by OCaml usingsscanf
, which is not provided innolibc
. I settled to keep that simple patch, at least for now, rather than come up with asscanf
(do we want to provide a hard-coded version that would work only for that single use case or a real implementation?).Commit overview
crossopt
andinstallcross
rulesqsort
andlongjmp
solo5.conf
to support OCaml-provided librariespath
Makefile
)