[GOB] Relocatable OCaml 5.4#297
Open
dra27 wants to merge 19 commits into
Open
Conversation
Unify the two executable header implementations (cherry picked from commit 076b435)
Relocatable OCaml - explicit-relative paths in `ld.conf` (cherry picked from commit 1e05f34)
boot/ocamlc doesn't yet support -set-runtime-default and %standard_library_default.
Misc.String.to_utf_8_seq was added in PR#14014 for the testsuite, but isn't part of the backport. It's only needed in Bytelink, so share it from there instead.
boot/ocamlc still uses the old runtime-launch-info format and doesn't yet support -launch-method or -runtime-search.
Config.shebangscripts was added in PR#14014 for the testuiste, but isn't part of the backport. Similarly, Bytelink.read_runtime_launch_info was exposed, only to be deleted as part of PR#14245, so the backport cuts out this intermediate step by temporarily copying Bytelink.read_rutime_launch_info, which therefore needs deleting here.
- Byterntm removed from ocamlbytecomp and linked directly in
ocamlobjinfo (the test-in-prefix driver likewise links it directly)
- Cmm_helpers.emit_global_string_constant inlined into its single use in
Asmlink.make_startup_file
- Compenv.parse_runtime_parameter inlined into its single use in
Main_args and Compenv.fatalf consequently removed
- Config.as_is_cc moved to Toolchain.as_is_cc
- Config.target_{unix,win32,cygwin} removed and uses of
Config.target_win32 inlined
f374e30 to
aeb2d60
Compare
Virtually elimates changes to the runtime headers: - caml_parse_ld_conf (protected by CAML_INTERNALS) changes arguments, but this function was already checked for not being used outside the runtime as part of OCaml 5.5 - exec.h now includes <stdint.h> (protected by CAML_INTERNALS) - version.h now defines OCAML_RELEASE_NUMBER
In OCaml 5.5, the suffixing mode is enabled by default. For compatibility, the backports only enable this mode by default if --enable-runtime-search and/or --enable-runtime-search-target is specified (the usual validation rules for these flags still applies - i.e. --disable-suffixing is still prohibited if either --enable-runtime-search or --enable-runtime-search-target is specified)
Cmo_format.library.lib_dllibs is able to change type without a bootstrap because the bootstrap cycle never reads a .cma which has any entries for dllibs (it fundamentally can't, because that would imply a dependency on dynamic loading, which isn't permitted in ultra-portable bootstrap) However, the format absolutely cannot change without ultimately changing the cma magic number, which is non-trivial, because we don't normally change the magic numbers in maintenance releases, and the numbering scheme consequently doesn't reserve space for them. This is worked around instead by leaving Cmo_format.library unaltered and instead writing a _second_ list after the Cmo_format.library in the cma format. This list is guarded with the cma magic number, but written in reverse. If this magic number is present, then the list must follow and must be the same length as lib_dllibs. If the magic number is not present, then the suffixed member of each lib_dllibs is assumed to be false, which is used also used as an "optimisation" to avoid writing the extra list at all when none of entries have suffixed:true.
As with Cmo_format.library, the type of Cmx_format.unit_infos cannot change without changing the cmx and cmxa magic numbers, which is similarly awkward. The workaround here is slightly simpler, if also somewhat more devious. Cmx_format.unit_infos is handily a fully mutable record, meaning that there are few if any optimisation assumptions which will ever be made around it. For the compiler, the interface is altered to add Compilenv.needs_stdlib_location which takes a Cmx_format.unit_infos and "accesses" its ui_need_stdlib field. In parallel, Compilenv.write_unit_info gains an optional ui_need_stdlib argument which allows the field to be specified when a Cmx_format.unit_infos is written to a file. The devious part is that instead of writing a Cmx_format.unit_infos value, Compilenv.write_unit_info writes a tuple with one extra element for the ui_need_stdlib field to be added in. Compilenv.needs_stdlib_location looks to see if the Cmx_format.unit_infos it has been passed in fact contains an extra field in the block and, if it does, reads it.
Relocatable OCaml - to opam and beyond (cherry picked from commit f6c8af4)
Improve installation time in opam by shrinking the Git-generated source archives (cherry picked from commit 172b5c5)
ea0e710 to
47650b0
Compare
6a05d55 to
be815cc
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.
No description provided.