Install a relocatable gmp.pc - #29
Open
samoht wants to merge 1 commit into
Open
Conversation
This was referenced Jun 18, 2026
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 21, 2026
End-to-end macOS check: build the aarch64 cross-compiler and cross-build zarith (C stubs + GMP) with it. Pins the not-yet-released forks (Solo5/solo5#641, mirage/ocaml-gmp#29, ocaml/Zarith#173); drop this commit, or at least the pins and fork clones, once they are in opam.
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 21, 2026
Pin the not-yet-released forks (Solo5/solo5#641, mirage/ocaml-gmp#29, ocaml/Zarith#173) and build the cross-compiler plus zarith through opam. Drop this commit (or at least the pins) once they are in opam.
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 21, 2026
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc. Pins the not-yet-released forks (also mirage/ocaml-gmp#29); drop this commit, or at least the pins, once they are in opam.
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 21, 2026
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: install ocaml-gmp (mirage/ocaml-gmp#29) for its relocatable gmp.pc, then point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` and PKG_CONFIG_PATH at that gmp.pc so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc against ocaml-gmp. Drop this commit, or the pins, once the forks are in opam.
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 21, 2026
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: install ocaml-gmp (mirage/ocaml-gmp#29) for its relocatable gmp.pc, then point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` and PKG_CONFIG_PATH at that gmp.pc so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc against ocaml-gmp. Drop this commit, or the pins, once the forks are in opam.
This was referenced Jun 21, 2026
samoht
force-pushed
the
ship-gmp-pc
branch
2 times, most recently
from
June 21, 2026 23:22
52e9109 to
0221100
Compare
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 22, 2026
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: install ocaml-gmp (mirage/ocaml-gmp#29) for its relocatable gmp.pc, then point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` and PKG_CONFIG_PATH at that gmp.pc so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc against ocaml-gmp. Drop this commit, or the pins, once the forks are in opam.
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 23, 2026
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: install ocaml-gmp (mirage/ocaml-gmp#29) for its relocatable gmp.pc, then point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` and PKG_CONFIG_PATH at that gmp.pc so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc against ocaml-gmp. Drop this commit, or the pins, once the forks are in opam.
samoht
added a commit
to samoht/ocaml-solo5
that referenced
this pull request
Jun 23, 2026
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: install ocaml-gmp (mirage/ocaml-gmp#29) for its relocatable gmp.pc, then point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` and PKG_CONFIG_PATH at that gmp.pc so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc against ocaml-gmp. Drop this commit, or the pins, once the forks are in opam.
Member
|
is this ready? CI is red. |
Member
|
from a quick review: how should an update of gmp happen? in your here provided "gmp.pc" there is a version number of gmp hardcoded. is this intentional? can you think of a different path to generate this file or the version number during the build process, so if we are upgrading the source tarball we don't have to remember to update the hardcoded version here? |
Member
Author
|
I think |
Member
Author
|
I've amended my commit to use opam subst. However we already harcode the version in the dune file here: https://github.com/mirage/ocaml-gmp/blob/main/src/dune#L16C7-L16C24 so I guess it's fine to centralise this in there (in case we don't use opam to build the package)? |
samoht
force-pushed
the
ship-gmp-pc
branch
2 times, most recently
from
July 23, 2026 00:20
97d8f1b to
3b57f62
Compare
This file contains hidden or 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
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.
Consumers that find GMP through
pkg-config gmp(e.g. zarith's configure) get nothing today: this package shipsgmp.handlibgmp.a, but no.pcfile.This PR installs a relocatable
gmp.pcunderlib/pkgconfig. The prefix uses${pcfiledir}, so it resolves from any install location, including a cross sysroot, without baking an absolute-Lpath.Stacked on #31 (the cross CI bump); the diff here is only the
gmp.pcinstall.The rest of the macOS unikernel stack:
OCAML*environment variables in configurelibgmp.awith the crossar/ranlib