If an allocation fails, the decrement of young_ptr should be undone
before the GC is entered. This happened correctly on bytecode but not
on native code.
This commit (squash of pull request #8619) fixes it for all the
platforms supported by ocamlopt.
amd64: add alternate entry points caml_call_gc{1,2,3} for code size
optimisation.
powerpc: introduce one GC call point per allocation size per function.
Each call point corrects the allocation pointer r31 before calling
caml_call_gc.
i386, arm, arm64, s390x: update the allocation pointer after the
conditional branch to the GC, not before.
arm64: simplify the code generator: Ialloc can assume that less than
0x1_0000 bytes are allocated, since the max allocation size for the
minor heap is less than that.
This is a partial cherry-pick of commit 8ceec on multicore.
A #! line should not exceed 128 characters (including the \0
terminator). This adds a test - both to the generation of the camlheader
files and also to the -use-runtime flag which falls back to #!/bin/sh
and uses exec to invoke the the interpreter.
There were some issues in the way parameters from Makefile.config
are inserted in utils/config.mlp to produce utils/config.ml:
- Some of the make functions involved used parameter "$2" yet
were called with only one argument, causing a warning by
"make --warn-undefined-variables".
- Despite heroic attempts, special characters in the parameters
were not always quoted or quoted enough. For example,
if FLEXDLL_DIR is C:\foo, the generated utils/config.ml
contains "C:\foo", which is not a valid OCaml string literal.
This commit fixes these issues by:
- Revising and commenting the make functions that produce
the properly-quoted sed substitution commands.
- Adding an extra round of quoting for variables used inside
OCaml's string literals "..." (function SUBST_STRING)
- Adding two round-trip tests (make test-subst, make test-subst-string)
to make sure that all printable characters are properly quoted.
This generic Makefile is parameterized by several "make" variables,
- two that must be set by the calling Makefile
- nine that can be set by the calling Makefile but have default values
otherwise.
This commit sets explicitly the default values of the nine variables above,
using "VAR ?= default-value", even if the default value is the empty string.
This avoids spurious warnings by "make --warn-undefined-variables"
and is good documentation-in-code.
Previously, if the native-code compiler is not supported
(e.g. because configure doesn't recognize the target architecture,
or is run with --disable-native-compiler), "make world.opt"
fails late and with a mysterious error message
(a warning about undeclared C functions in runtime/roots_nat.c
or runtime/backtrace_nat.c, typically).
This commit ensures that "make world.opt", "make opt" and "make opt.opt"
fail immediately with a meaningful error message if the native-code
compiler is not supported.
Note: in "world.opt", make sure that "checknative" is run, and only
then "coldstart"; don't run them in parallel.