Commit
86363fdf3c408f825aa62abb015447305dfb793e
by david.allsopp
Add optional static and mimimal jobs
Tests a full `--disable-shared` build on Linux and also a Linux build with as many options disabled as possible (as the minimal build in the other-configs job on Jenkins also does).
The matrix is expanded by adding the 'CI: Full matrix' label to a pull request.
Commit
52c61d8f9ed1975bdda6294e7d543638c4e3e3e0
by david.allsopp
Fix test_create_cursor_failures.ml on Cygwin
If Cygwin is running "elevated" - which it is in CI - then it acts as though it's running as root. It intentionally activates SeBackupPrivilege, which thwarts the test_create_cursor_failures.ml test.
The OCaml testsuite will never require root privileges for anything meaningful, so ocamltest on Cygwin simply drops the SeBackupPrivilege when running on Cygwin, which means the test correctly fails.
Commit
b6385e306d5433690a3fefe4cf8941b6c285fa6a
by david.allsopp
Set FLEXDIR when bootstrapping flexlink
Previously, the flexdll support objects were placed in both byte/bin and opt/bin with the copy of flexlink.exe when flexlink was being bootstrapped with OCaml. The objects are small, so the copying was not particulary onerous.
However, if opt/bin/flexlink.exe is a native Windows symlink (pointing to ../../flexlink.opt.exe) then Sys.executable_name when flexlink runs will point to the wrong place. While flexlink ought to be checking Sys.argv.(0) rather than Sys.executable_name, a better hardening is to be explicit and set the FLEXDIR environment variable to point to the directory containing the support objects. This also allows byte/bin/flexlink.exe and opt/bin/flexlink.exe to share the same copy of the objects.
Commit
af1a56c42810b68d70bbb4492cb51dbcc23e7bfd
by david.allsopp
Add caml_sys_proc_self_exe primitive
caml_executable_name is always called in native startup and for all the non-default bytecode linking mechanisms. Bytecode startup now always calls caml_executable_name, and this value is stored along with exe_name.
caml_sys_proc_self_exe returns this stored value as a string option. It returns None if caml_executable_name is not implemented on a given platform.
Commit
b5e685f1da25998f8f156c264e7c93636acd0b07
by david.allsopp
Add Sys.runtime_executable
In native mode, same as Sys.executable_name, in bytecode, the path to the interpreter executing Sys.executable_name, which may not be the same from the same file.
Commit
2ceaa6347963949c4da4d230e27f8557100a1b41
by david.allsopp
Add Compmisc.reinit_path
Compmisc.init_path initialises the load path using Config.standard_library. Compmisc.reinit_path generalises this, allowing an alternate value for the standard library location to be used. This is used internally when testing compiler installations in order to allow Ccomp.call_linker to be used.
Commit
15351eef5632e81f12f87856ca7f0f4567861ac6
by david.allsopp
Don't add a double-separator when locating ld.conf
When calculating the full path for ld.conf, the runtime unconditionally concatenated "/ld.conf". This is harmless when the separators appear in the middle of a path ("/usr/local/lib/ocaml//ld.conf" is equivalent to the version with only single slashes), but it is technically incorrect for two corners cases with OCAMLLIB and CAMLLIB:
- if either is explicitly set to "/" then "//ld.conf" is _not_ the same file as "/ld.conf". This is mildly relevant on Windows and Cygwin where the two initial slashes (including as "\/" for native Windows) will be interpreted as a UNC path - if either is explicitly blank, then "ld.conf" (i.e. ld.conf in the current directory) is a less illogical file to open than "/ld.conf"
Commit
d4ce80ae70e33f1face2b838eb69f27fef86a5b3
by david.allsopp
Remove caml_get_stdlib_location
The function was only ever added to share the logic between dynlink.c and startup_byt.c - now that dynlink.c doesn't require it, move the function to startup_byt.c and make it internal again.
Commit
de200ad3d47668e788e3f96b4e26dbb6e2db6ea7
by david.allsopp
Use caml_parse_ld_conf in ocamlc
Eliminate the need for two implementations of the parsing logic for ld.conf by sharing the C implementation (which must exist, since it's part of bytecode startup) with the bytecode compiler, replacing Dll.ld_conf_contents
Commit
bbecf548a77d2789b597da2a0b6966c804003d6b
by david.allsopp
Fix the detection of Cygwin-like build environments
Both Cygwin and MSYS2 are now consistently detected on MSYS2. In particular, this means that ./configure --prefix $PWD/install and similar will cause the prefix to be correctly translated to a Windows path, as already happens on Cygwin.
Commit
7909b39e7b8b994559e1d5f7a6457bd1a5c5a811
by david.allsopp
Preserve backslashes in --prefix
Previously, the --prefix argument was always normalised with cygpath -m which meant that regardless of the argument, the paths used in the compiler would always use slashes.
This behaviour is preserved if a slash is detected in the argument, i.e. the caller explicitly uses mixed notation (e.g. `--prefix=C:/Prefix` or `--prefix $PWD/install`). In particular, it means that a Cygwin-style path will be correctly converted to a Windows-style path.
If the path uses backslashes, then it is still converted to use forward slashes for the installation commands, but the backslashes are otherwise preserved and used within the build itself.
Commit
d79b6eda4e1579b972df93cc6828ba931e420e44
by david.allsopp
Harden startup of -custom executables
By default, ocamlrun first tries to resolve argv[0] to determine where the bytecode image is and then tries opening the executable image itself. This is obviously correct for ocamlrun, when being called using a shebang or executable header, but it's not correct for -custom executables where we _know_ that the bytecode image should be with the executable. To achieve this, a new mode is added to caml_byte_program_mode (and the existing ones renamed) such that caml_byte_program_mode is now STANDARD (for ocamlrun - the existing behaviour), APPENDED (for -custom executables - the new behaviour) and EMBEDDED (for -output-complete-exe/-output-obj - the original use of it).
The mode is also set directly by the linker, rather than having a default in libcamlrun which is then overridden by the startup code for -output-complete-exe.
In the new APPENDED mode, if caml_executable_name is implemented (i.e. it returns a string) then this file _must_ contain the bytecode image and no other mechanisms are used. On platforms where caml_executable_name is not implemented, APPENDED falls back to STANDARD for compatibility.
Technically, this stops an argv[0] injection attack on setuid/setgid -custom bytecode executables, although setuid should be used with -output-complete-exe, if at all.
Commit
6b619ea0c7dfdf7160a4390b01afa41f6c0e1f98
by david.allsopp
Interpret . in runtime-launch-info
The runtime-launch-info file includes the location of the binary directory. The compiler is extended so that . refers to the directory of the compiler binary.
Commit
3fea5f1dde60b772b43f18db50df1e0ee70ea731
by david.allsopp
Add --with-relative-libdir configure option
--with-relative-libdir can be used instead of --libdir to specify a directory relative to --bindir which is used by the compiler to compute the location of the Standard Library.
Commit
59c0e2524010ddcf8ae059ba73d9eb8c8fa80d6c
by david.allsopp
Add caml_standard_library_default to the runtime
Previously, the bytecode runtime just use OCAML_STDLIB_DIR from build_config.h. This value is now stored once in stdlib.o as caml_standard_library_default.
Commit
3dc1b7ecd4d7c17f3141ac865b5d1929784c9709
by david.allsopp
Allow libdir to be found relative to bindir
When configured with --with-relative-libdir, the runtime uses the directory of the executable to determine the location of the Standard Library. Thus, ocamlrun and the compilers look for ../lib/ocaml by default.
This is implemented by changing caml_standard_library_default to be a relative path, and then computing the actual value at startup (for bytecode) and when queried (for native, since it is only ever used if Dynlink is being used).
Executables (and objects) produced by the compiler always have an absolute value of caml_standard_library_default. ocamlc.opt and ocamlopt.opt are built using -set-global-string to force caml_standard_library_default to stay a relative value.
Commit
b957ce93d4fb93be7c94615b2fc14d5afc402978
by david.allsopp
Detect but ignore -fdebug-prefix-map on mingw-w64
mingw-w64 is based on GCC, so supports -fdebug-prefix-map, but the test for it is skipped in configure. The test is no longer skipped (which means that Config.c_has_debug_prefix_map returns true) but the flag is still explicitly not used by the compilers (as before).
Commit
6842b79a5a37fdbc908fb93ba348882aa7f812ed
by david.allsopp
Reduce tmpheader.exe to 4-5KiB on Windows
stdlib/headernt.c was adapted in OCaml 3.00 to reduce its size by avoiding the use of the CRT and using Windows API functions directly (this is a well-studied trick on Windows, principally as a puzzle for producing tiny binaries).
This got "regressed" slightly in OCaml 4.06, in the complex introduction of wide character support for Windows, as the mingw-w64 incantation required was unclear, so the entry point was changed to wmain, and the size of the header increased.
By switching from wcslen (a CRT function) to lstrlen (a Win32 API function), headernt.c again only requires kernel32.dll.
Additional flags are added for both ld (mingw-w64) and link (MSVC) to squeeze every last byte out of tmpheader.exe. The MSVC version of the header is once again no longer passed through strip, as this was found to be corrupting the executable (and had never been reducing its size anyway).
Commit
0811c5ca04787ed5e52f4bc9dc6ff2d0e3eea403
by david.allsopp
Stop using Caml_inline and Camlnoret in headernt.c
headernt.c will never be compiled with a C++ compiler, so _Noreturn can be used directly, and modern C compilers are sufficiently intelligent to work out when to inline!
Commit
479079d6219d303e9f79131b63ed293fe45a317b
by david.allsopp
Remove unnecessary guards around unistd.h
Already updated to remove the actual test in s.h, since XPG1 (1985) required it and it is therefore part of the Single Unix Specification (1992), but the _WIN32 guard and the loading of s.h are unnecessary.
Commit
925fd46cf1f9cdb36e9749cc76272735a7a7d4e0
by david.allsopp
Add -launch-method to ocamlc
When linking a normal bytecode executable, allows an explicit selection of either the executable or shebang header, regardless of the value in runtime-launch-info.
Commit
46d259d26d7fc989a287ff9250f0f5fb209fd644
by david.allsopp
Build suffixed shared runtimes
New names for libcamlrun_shared.so and libasmrun_shared.so without the _shared suffix and using the target triplet and runtime ID. Both ocamlc and ocamlopt explicitly recognise `-runtime-variant _shared` and select the correct name.
Symbolic links for libcamlrun_shared.so and libasmrun_shared.so to allow any C programs which linked against the the output of `-output-obj` to continue to work.
Commit
a8a2349a25594cc1e2ad38cabfc97bddd45ed50a
by david.allsopp
Add runtime suffixes to bytecode stub libraries
ocamlc -dllib-suffixed appends the runtime's host triplet and bytecode runtime ID to the supplied name when searching for the DLL, and records the base name only in .cma / executable files.
ocamlmklib -suffixed instructs ocamlmklib to use -dllib-suffixed when generating .cma files instead of -dllib.
The effect is that stub libraries built this way have names which will be unique for a given configuration of OCaml and so will be ignored by other runtimes.
Commit
17af444810e3867105554c90f1f119940b6f676a
by david.allsopp
Add -runtime-search to ocamlc
-runtime-search {disable|enable|always} adds new features to the launcher used for bytecode executables which do not embed their own runtime. By default, the header continues to behave as before - the launcher will attempt to start the runtime using the absolute path which the compiler was configured with.
The new search mode will then search for the runtime first in the directory containing the running executable and then in PATH.
Commit
805204e26de0488c3542984a43eb7f880d85a64a
by david.allsopp
Add --enable-runtime-search[-target] options
--enable-runtime-search controls the -runtime-search setting used to build the compiler's own bytecode executables; --enable-runtime-search-target controls the default value of -runtime-search that ocamlc itself uses.
Commit
276648afb4c9714596dace4421771f6900c234aa
by david.allsopp
header.c: remove unnecessary Cygwin workaround
This is no longer required (nor does it work). Cygwin 1.5.20 (July 2006) added the transparent_exe option to the CYGWIN environment variable which made open behave in the same way as stat. Cygwin 1.7.1 (December 2009 and, despite the version number, the first release of Cygwin 1.7) made this behaviour default (and removed the ability to turn it off).
Commit
9d06b67b086f9cd866968cea7cfa4080a9be181a
by david.allsopp
Simplify the interface of caml_attempt_open
Previously, caml_attempt_open received a pointer to the string and passed this string to caml_search_exe_in_path. This function allocates a fresh string which was then assigned to that pointer.
This interface was a little cryptic to follow - in particular, there were several scenarios in which the result was not being freed. It's also not entirely clear that caml_attempt_open involved a PATH-search, which appears to have been applied in error when CAML_DEBUG_FILE was added.
Commit
971956234ce012bffb7286b7b0e1bbc3bd6eb55a
by david.allsopp
Preserve argv[0] on Unix in the executable header
Makes the behaviour of the Unix and Windows versions of the header equivalent, in particular it means that if argv[0] doesn't describe the executable, more things fail for Cygwin.
Commit
a0b0f4e03e92afcf74b2ef4f318210f7c74dce05
by david.allsopp
Harden the cloexec.ml test on Windows
On slower machines, it's possible for the main part of the test (in fdstatus_main.ml) to complete before the cloexec.ml has actually terminated as part of `Unix.execv` (this is an artefact of how the underlying CRT `execv` call is implemented on Windows).
Strictly on native Windows, cloexec.ml creates an additional dummy file and takes a write lock on it (with `Unix.lockf`). Before running, if this file exists, fdstatus_main.ml will also try to take a write lock on it, providing a way of fdstatus_main.ml being sure that its ancestor has fully terminated without actually having to know its PID.
Commit
900d87c3bf69a018a05cceb92d74592f796060b9
by david.allsopp
Fix STARTUPINFO structure in stdlib/header.c
If a CRT application (including, therefore, another OCaml program), exec's a bytecode program which uses the executable header, the cbReserved2 and lpReserved2 fields of the STARTUPINFO structure are quietly used by the CRT to pass handle information about open fds.
The status checker in the cloexec.ml test has C stubs, which causes ocamltest to compile the bytecode version with -custom. The test is split to have an additional intermediate pure OCaml program which simply repeats either the Unix.execv or Unix.create_process call with the Sys.argv it was applied. In bytecode, ocamltest compiles this program just with -use-runtime, which means it uses the executable header on Windows.
Without the change to header.c in this commit, that test begins to fail in bytecode on Windows, because the CRT information about inherited handles is not passed on to the status checker (the HANDLE values will have been inherited, as that's a kernel function, but the CRT structures regarding the fds are not initialised, which is what the checker than looks at).
The fix here simplifies the code considerably - rather than initialising a fresh STARTUPINFO structure, we simply use GetStartupInfo to retrieve the one which was used to create the process itself and pass that to CreateProcess - cbReserved2 and lpReserved2 are therefore passed on, and the cloexec.ml test passes again.
Commit
654e8a760f723afe532659ac76d28e535b91875e
by david.allsopp
Share image fd between header.c and startup_byt.c
The bytecode executable launcher (stdlib/header.c) can _only_ invoke ocamlrun after it has opened itself in order to find out the name of the runtime to execute. However, once ocamlrun is exec'd, the knowledge of this file was previously lost and if it could not be recovered from argv[0], then execution fails.
This new approach, for both Windows and Unix, instead keeps the fd for the bytecode image open and passes its number to ocamlrun as __OCAML_EXEC_FD in the environment. ocamlrun detects this environment variable and uses that fd to load the bytecode image. If this fails, the runtime does _not_ fallback to any other mechanisms.
On Windows, it is possible to recover the filename from a HANDLE. It is not portably possible to do this on Unix, so the filename which was opened by the stdlib/header.c is instead appended to the environment variable.
Commit
307ef05ed20600dd219fb112847bab7eab22e1c8
by david.allsopp
Add comments on the handling of blank env vars
Clarify in various places the behaviour of reading an environment variable which is "Set But Null" (i.e. equal to the empty string as opposed to unset)
Commit
ecb51c0fe0a521846f8c97a00e551b4d4f3f79c5
by david.allsopp
Propagate non-empty tmpdir in ocamlyacc
By making tmpdir explicitly "." in the rare corner-case of TMPDIR being set to the empty string on Windows, it becomes unnecessary to keep checking whether tmpdir is zero-length.
Commit
e60c3f2a2ded8d5a4348edee2e7ffcc451eeea91
by david.allsopp
Use non-raising Sys.getenv_opt in win32unix
Use the non-raising Sys.getenv_opt internally in the Windows implementation of the Unix module. In passing, treat the highly unlikely corner case of COMSPEC being "Set But Null" as if COMSPEC were not set.
Commit
3ec0672e708821212e2aba6aff811c2354735269
by david.allsopp
Ignore empty strings in Compmisc.set_from_env
Previously, invocations such as
OCAML_COLOR= ocamlopt
emitted warning 46 (bad-env-variable) which is not particularly helpful. At present, Compmisc.set_from_env is used to implement OCAML_COLOR and OCAML_ERROR_STYLE, neither of which attached significance to the empty string. Compmisc.set_from_env is there changed to explictly ignore the environment variable value if it is "".
Commit
e411e2736db77a17e6f068dff4003e4b60496668
by david.allsopp
Ignore empty environment variables in ocamltest
Most uses in ocamltest were via its safe_getenv function which already made unset and empty equivalent. This generalises the underlying getenv_with_default_value function always to return the default value if the variable is _either_ unset or set to the empty string.
Commit
be8b5b953efe01b22112b4359baaa44fbed6af12
by david.allsopp
Treat OCAML_BINANNOT_WITHENV as unset when empty
This environment is intended to be used in the context of OCAML_BINANNOT_WITHENV=1 to enable it, so treat OCAML_BINANNOT_WITHENV= as if it weren't set at all.
Commit
10d2b42d2422ecd8c7bc01e79b5f8685e74091ea
by david.allsopp
Harden processing of SOURCE_DATE_EPOCH in ocamldoc
Previously, running:
SOURCE_DATE_EPOCH= ocamldoc
resulted in an uncaught Failure "float_of_string" exception. The processing of SOURCE_DATE_EPOCH is firstly hardened to cope with parsing errors and then a one-time warning is displayed the first time it's actually used (at present it's only required in Odoc_man).
Commit
10323701477bf679f72aef9d2a18063943953721
by david.allsopp
Ignore empty OCAML_RUNTIME_EVENTS_ variables
The handling of OCAML_RUNTIME_EVENTS_DIR was incorrect if the value as "Set But Null" and the intention in the manual for OCAML_RUNTIME_EVENTS_START and OCAML_RUNTIME_EVENTS_PRESERVE is clearly that they should be set to non-empty values in order to trigger the required effect.
All three variables are now ignored if they are set, but to an empty string.
Commit
81486b09a676c4d148a22bf0f67f845138248e3c
by david.allsopp
Ignore blank OCAMRUNPARAM, OCAMLLIB and CAMLLIB
Previously, if OCAMLRUNPARAM was "Set But Null", CAMLRUNPARAM was completely ignored. Similarly, a "Set But Null" value for OCAMLLIB caused CAMLLIB and subsequently the default location of the Standard Library to be ignored. Especially for OCAMLLIB/CAMLLIB, this behaviour is counter-intuitive, as it's highly unlikely to be useful.
Now, if OCAMLLIB is set, but to the empty string, then CAMLLIB is checked and, more importantly, if it is either not set or also set to the empty string then the default location of the Standard Library is still used. For consistency, if OCAMLRUNPARAM is set, but to the empty string, then CAMLRUNPARAM is read.
Commit
c1ebfe748dcf157e32076a2d205c8b52dbd37e1f
by david.allsopp
Ignore empty components in PATH-like things
POSIX recognises empty components in a PATH-like variable as meaning "." (the current directory). This is reflected in the processing of OCAMLTOP_INCLUDE_PATH, CAML_LD_LIBRARY_PATH and ld.conf where either a blank component or a blank line is interpreted as "."
Somewhat confusingly, this processing is applied inconsistently between Unix and Windows (it's confusing given that Windowsm more readily includes the current working directory by default in PATH searches).
It also has the side-effect that a "Set But Null" environment variable is interpreted as "." which counter-intuitively makes CAML_LD_LIBRARY_PATH= ocamlrun add the current working directory to the search path.
Blank lines and empty components of both OCAMLTOP_INCLUDE_PATH and CAML_LD_LIBRARY_PATH are now ignored. The current working directory can still be explicitly included, of course, by adding a "." entry/line where required.
Commit
3a99ba402b4c3d85f054afed95f33c4ce23fe005
by david.allsopp
Fix C library options for win32unix
-lws2_32 and -ladvapi32 are already supplied by default, so they don't need to be in unix.cma/unix.cmxa. However, they do need to be passed when building unix.cmxs, and they were previously acquired via unix.cmxa. Tweak the way LDOPTS is used in Makefile.otherlibs.common (which now is only used for the unix library) so that it's correctly passed to both ocamlopt and ocamlmklib.
Commit
d5448c13f24fa234000f7df595450e26783500f8
by david.allsopp
Fix inclusion of libraries when partial linking
ld -r (certainly in GNU binutils) has an empty search path - co-opt the MSVC search code and always resolve libraries when partial linking, except this time _ignore_ the ones which are missing. This seems to fit the rest of -output-complete-obj, given that the _standard_ C libraries are also omitted (-lm, -lpthread, etc.)
Commit
94d90e080d309070665e461822c79ae24e29a2c9
by david.allsopp
Stop installing and documenting config_main, etc.
Config_main and Config_boot are built to ensure in the build that utils/config.generated.ml.in and utils/config.fixed.ml are kept in sync (so that the next bootstrap doesn't unexpectedly break). However, because these files were generated in the utils directory, they were picked up both by the install recipe and also when generating API documentation.
It's slightly hairy to remove the wildcards and use filter, because we can easily end up with command lines which are too long (even on Unix), so instead these two modules are now generated in utils/config/
Commit
bbbe8ce594e904d952760ef5a8f53ef3f4800046
by david.allsopp
Improve the "dynamic loading not supported" error
It is possible, especially when using Dynlink, to end up in the situation where a bytecode runtime which doesn't support dynamic loading is asked to load support DLLs (e.g. a bytecode image with a DLLS section, or a cma archive passed to the toplevel/Dynlink which has a non-empty lib_dllibs list).
Previously, the error message would refer to the name of the first DLL being loaded and simply state that dynamic loading is not supported. The confusing part is that typically this would refer to a DLL which is not on the system.
Now, the bytecode linker only writes DLLS and DLPT when there are entries to write in them, and the runtime, toplevel and Dynlink provide a direct explanation that dynamic loading is needed, but is not available. In particular, the error now refers to the file which is being loaded (i.e. the bytecode executable or the .cma file) rather than a .so file which doesn't exist.
Commit
72f6f200e76d515c76c7cc6bf4cf37af6bb3aba8
by david.allsopp
Free tables after handing off to Dynlink
In the debug runtime, caml_prim_name_table remains for the lifetime of the program, as it's used by instrtrace.c, but in normal operation, once the list of primitives has been handed over to Dynlink, its no longer required. In the normal runtime, it's now freed after this handover.
In passing, strings themselves are no longer duplicated, as the code path is a good deal simpler than it used to be, and the bytecode section itself can reliably be used as the underlying buffer for caml_prim_name_table.
caml_shared_libs_path is only kept at all to be handed over to Dynlink. It, along with the two underlying buffers for CAML_LD_LIBRARY_PATH and ld.conf are freed after the call.
Commit
396cea3bbea9652f1e044ec3809d0159d8761948
by david.allsopp
Preserve option R in caml_runtime_parameters
The setting for R was previous omitted in Sys.runtime_parameters, since it was only processed directly by the Hashtbl module and not stored in the runtime. Option R is now processed in caml_parase_ocamlrunparam and stored to be accessed and updated via new primitives for the Hashtbl module.
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Commit
f23ad31bf82ef810bfdc7892380ac75cbaec73a3
by david.allsopp
Add -set-runtime-default to the compilers
When linking an executable, allows to set default to OCAMLRUNPARAM values. This new OCAMLRUNPARAM string is accessible using the "caml_executable_ocamlrunparam" symbol or is embedded in a bytecode section.
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Commit
f2ba0dd864bc1383960f2dd818549c94f1831f04
by david.allsopp
Test -set-runtime-default in test-in-prefix
The test programs in the run after the prefix has been renamed are compiled with `-set-runtime-default R`, and the test program verifies that Hashtbl.is_randomized returns the expected value.
Commit
db3fbbb84b17718600a61486805bd3e9eb66e1f1
by david.allsopp
Support c=1 mode in ocamlrun
The runtime's pooling mode has a slight Catch-22 problem for ocamlrun when enabled using -set-runtime-default. Opening the bytecode file and reading the ORUN section requires the memory subsystem.
In this revised version, caml_main in bytecode is particularly careful to track exactly what will have been allocated prior to reading the ORUN section and if ORUN requires the system to start pooling mode, the runtime now takes temporary malloc'd copies of everything which has been made so far so that it can be safely copied with a caml_stat_alloc _after_ pooling mode has been enabled.