Skip to content

Make cross compiler relocatable - #26

Closed
shym wants to merge 6 commits into
trunkfrom
cross-rel
Closed

Make cross compiler relocatable#26
shym wants to merge 6 commits into
trunkfrom
cross-rel

Conversation

@shym

@shym shym commented Jun 25, 2026

Copy link
Copy Markdown
Owner

No description provided.

shym added 2 commits July 13, 2026 15:59
In the cross-compilers CI tests, update the configuration of the initial
non-cross compiler to set the same options than in standard opam
packages (`ocaml-variants.opam` or the released `ocaml-compiler`
packages)
shym added 4 commits July 13, 2026 18:13
The `HOST_LIBDIR` variable was used only internally in `Makefile.common`
so that `Makefile.cross` could override it. But when a cross compiler is
configured, even with `--with-relative-libdir`, the resulting value was
absolute because `LIBDIR` is then the concatenation of the binary
directory with the relative libdir path.
This introduces a matching `host_libdir` variable in `configure` to
store the relative path when it is set and so that `HOST_LIBDIR`
contains the expected value in cross and non-cross cases.

This also allows to set both `--with-relative-libdir` and
`TARGET_LIBDIR` explicitly when building a cross compiler, where the
relative libdir is meant for the host.
Set the `configure`-internal `default_separator` variable according to
host instead of target and rename it `host_dir_sep` to make this more
explicit
This makes the `--with-relative-libdir` option choose the proper path
and the test that the path is explicit relative consistent (but it
doesn't fix the fact that some paths are currently shared between host
and target)

Note that the change is transparent when host = target
When configuring a cross compiler with
`./configure --with-relative-libdir TARGET_LIBDIR=...`
use `TARGET_LIBDIR` instead of the host libdir to set
`target_libdir_is_relative`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant