+OCaml 4.10.1 (20 August 2020)
+-----------------------------
+
+### Runtime system:
+
+- #9344, #9368: Disable exception backtraces in bytecode programs
+ built with "-output-complete-exe". At the moment, such programs do
+ not embed debug information and exception backtraces where causing
+ them to crash.
+ (Jérémie Dimino, review by Nicolás Ojeda Bär)
+
+### Build system:
+
+- #9531: fix support for the BFD library on FreeBSD
+ (Hannes Mehnert, review by Gabriel Scherer and David Allsopp)
+
+### Bug fixes:
+
+- #9068, #9437: ocamlopt -output-complete-obj failure on FreeBSD 12
+ (Xavier Leroy, report by Hannes Mehnert, review by Sébastien Hinderer)
+
+- #9165, #9840: Add missing -function-sections flag in Makefiles.
+ (Greta Yorsh, review by David Allsopp)
+
+- #9495: fix a bug where bytecode binaries compiled with `-output-complete-exe`
+ would not execute `at_exit` hooks at program termination (in particular,
+ output channels would not be flushed).
+ (Nicolás Ojeda Bär, review by David Allsopp)
+
+- #9714, #9724: Use the C++ alignas keyword when compiling in C++ in MSVC.
+ Fixes a bug with MSVC C++ 2015 onwards.
+ (Antonin Décimo, review by David Allsopp and Xavier Leroy)
+
+- #9736, #9749: Compaction must start in a heap where all free blocks are
+ blue, which was not the case with the best-fit allocator.
+ (Damien Doligez, report and review by Leo White)
+
+### Tools:
+
+- #9552: restore ocamloptp build and installation
+ (Florian Angeletti, review by David Allsopp and Xavier Leroy)
+
OCaml 4.10.0 (21 February 2020)
-------------------------------
(KC Sivaramakrishnan and Stephen Dolan,
compatibility hacking by David Allsopp, Florian Angeletti, Kate Deplaix,
Jacques Garrigue, Guillaume Munch-Maccagnoni and Nicolás Ojeda Bär,
- review by David Allsopp, Alain Frisch, Nicolas Ojeda Bar,
+ review by David Allsopp, Alain Frisch, Nicolás Ojeda Bär,
Gabriel Scherer, Damien Doligez, and Guillaume Munch-Maccagnoni)
- #8993: New C functions caml_process_pending_actions{,_exn} in
(Florian Angeletti, review and suggestion by Gabriel Scherer)
- #9088, #9097: fix operator character classes
- (Florian Angelettion, review by Gabriel Scherer,
+ (Florian Angeletti, review by Gabriel Scherer,
report by Clément Busschaert)
- #9169: better documentation for the best-fit allocation policy
* #6792, #8654 ocamldebug now supports programs using Dynlink. This
changes ocamldebug messages, which may break compatibility
with older emacs modes.
- (Whitequark and Jacques-Henri Jourdan, review by Gabriel Scherer
+ (whitequark and Jacques-Henri Jourdan, review by Gabriel Scherer
and Xavier Clerc)
- #8621: Make ocamlyacc a Windows Unicode application
(Florian Angeletti, review by Gabriel Scherer)
- #9015: fix fatal error in pprint_ast (#8789)
- (Damien Doligez, review by ...)
+ (Damien Doligez, review by Thomas Refis)
### Bug fixes:
OCaml 4.09 maintenance branch:
------------------------------
+### Build system:
+
+- #9383: Don't assume that AWKPATH includes .
+ (David Allsopp, report by Ian Zimmerman)
+
+OCaml 4.09.1 (16 Mars 2020):
+----------------------------
+
- #8855, #8858: Links for tools not created when installing with
--disable-installing-byecode-programs (e.g. ocamldep.opt installed, but
ocamldep link not created)
* #2318: Delete the graphics library. This library is now available
as a separate "graphics" package in opam. Its new home is:
https://github.com/ocaml/graphics
- (Jérémie Dimino, review by Nicolas Ojeda Bar, Xavier Leroy and
+ (Jérémie Dimino, review by Nicolás Ojeda Bär, Xavier Leroy and
Sébastien Hinderer)
* #2289: Delete the vmthreads library. This library was deprecated in 4.08.0.
- #2278: Remove native code generation support for 32-bit Intel macOS,
iOS and other Darwin targets.
- (Mark Shinwell, review by Nicolas Ojeda Bar and Xavier Leroy)
+ (Mark Shinwell, review by Nicolás Ojeda Bär and Xavier Leroy)
- #8547: Optimize matches that are an affine function of the input.
(Stefan Muenzel, review by Alain Frisch, Gabriel Scherer)
fix in #8582 by Mark Shinwell, Xavier Leroy and Anil Madhavapeddy)
- #2265: Add bytecomp/opcodes.mli
- (Mark Shinwell, review by Nicolas Ojeda Bar)
+ (Mark Shinwell, review by Nicolás Ojeda Bär)
- #2268: Improve packing mechanism used for building compilerlibs modules
into the Dynlink libraries
pred, is_finite, is_infinite, is_nan, is_integer, trunc, round,
next_after, sign_bit, min, max, min_max, min_num, max_num,
min_max_num to module Float.
- (Christophe Troestler, review by Alain Frish, Xavier Clerc and Daniel Bünzli)
+ (Christophe Troestler, review by Alain Frisch, Xavier Clerc and Daniel Bünzli)
- #1354, #2177: Add fma support to Float module.
(Laurent Thévenoux, review by Alain Frisch, Jacques-Henri Jourdan,
- #2094, rewording for "constructor has no type" error
- #7565, #2140, more context for universal variable escape
in method type
- (Florian Angeletti, reviews by Jacques Garrique, Armaël Guéneau,
+ (Florian Angeletti, reviews by Jacques Garrigue, Armaël Guéneau,
Gabriel Radanne, Gabriel Scherer and Jeremy Yallop)
- #1913: new flag -dump-into-file to print debug output like -dlambda into
- #7676, #2144: Remove old GC heuristic
(Damien Doligez, report and review by Alain Frisch)
+* #1683: Change Marshal format to make Custom_tag objects store their
+ length. Old versions of OCaml will no longer be able to parse new marshalled
+ files containing custom blocks, but old files will still parse.
+ (Stephen Dolan)
+
- #1723: Remove internal Meta.static_{alloc,free} primitives.
(Stephen Dolan, review by Gabriel Scherer)
(steinuil, review by Marcello Seri, Gabriel Scherer and Florian Angeletti)
- #1797: remove the deprecated Makefile.nt files.
- (Sébastien Hinderer, review by Nicolas Ojeda Bar)
+ (Sébastien Hinderer, review by Nicolás Ojeda Bär)
- #1805: fix the bootstrap procedure and its documentation.
(Sébastien Hinderer, Xavier Leroy and Damien Doligez; review by
(Sébastien Hinderer, review by Damien Doligez and David Allsopp)
- #2148: fix a parallel build bug involving CamlinternalLazy.
- (Stephen Dolan, review by Gabriel Scherer and Nicolas Ojeda Bar)
+ (Stephen Dolan, review by Gabriel Scherer and Nicolás Ojeda Bär)
- #2264, #7904: the configure script now sets the Unicode handling mode
under Windows according to the value of the variable WINDOWS_UNICODE_MODE. If
- #1753: avoid potential off-by-one overflow in debugger socket path length.
(Anil Madhavapeddy)
-* #1683: Change Marshal format to make Custom_tag objects store their
- length. Old versions of OCaml will no longer be able to parse new marshalled
- files containing custom blocks, but old files will still parse.
- (Stephen Dolan)
-
### Tools:
- #7643, #1377: ocamldep, fix an exponential blowup in presence of nested
- #1623: Segfault on Windows 64 bits when expanding wildcards in arguments.
(Marc Lasson, review by David Allsopp, Alain Frisch, Sébastien Hinderer,
- Xavier Leroy, Nicolas Ojeda Bar)
+ Xavier Leroy, Nicolás Ojeda Bär)
- #1661: more precise principality warning regarding record fields
disambiguation.
with thread support, will now only suppress Sys_error exceptions in
Pervasives.flush_all. This should allow exceedingly unlikely assertion
exceptions to escape, which could help reveal bugs in the standard library.
- (Markus Mottl, review by Hezekiah M. Carty, Jeremie Dimino, Damien Doligez,
+ (Markus Mottl, review by Hezekiah M. Carty, Jérémie Dimino, Damien Doligez,
Alain Frisch, Xavier Leroy, Gabriel Scherer and Mark Shinwell)
- #1034: List.init : int -> (int -> 'a) -> 'a list
COMPFLAGS=-strict-sequence -principal -absname -w +a-4-9-40-41-42-44-45-48-66 \
-warn-error A \
-bin-annot -safe-string -strict-formats $(INCLUDES)
-ifeq "$(FUNCTION_SECTIONS)" "true"
-OPTCOMPFLAGS= -function-sections
-else
-OPTCOMPFLAGS=
-endif
LINKFLAGS=
ifeq "$(strip $(NATDYNLINKOPTS))" ""
ocamlopt_cmd = $(FLEXLINK_ENV) $(ocamlopt)
endif
+OPTCOMPFLAGS=
+ifeq "$(FUNCTION_SECTIONS)" "true"
+OPTCOMPFLAGS += -function-sections
+endif
# By default, request ocamllex to be quiet
OCAMLLEX_FLAGS ?= -q
-4.10.0
+4.10.1
# The version string is the first line of this file.
# It must be in the format described in stdlib/sys.mli
CYG_ROOT: C:/cygwin64
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
CYG_CACHE: C:/cygwin64/var/cache/setup
- FLEXDLL_VERSION: 0.37
+ FLEXDLL_VERSION: 0.38
OCAMLRUNPARAM: v=0,b
matrix:
- PORT: mingw32
\nint main(int argc, char **argv)\
\n#endif\
\n{\
+\n caml_byte_program_mode = COMPLETE_EXE;\
\n caml_startup_code(caml_code, sizeof(caml_code),\
\n caml_data, sizeof(caml_data),\
\n caml_sections, sizeof(caml_sections),\
\n /* pooling */ 0,\
\n argv);\
+\n caml_sys_exit(Val_int(0));\
\n return 0; /* not reached */\
\n}\n"
end else begin
let link objfiles output_name =
let objfiles =
- if !Clflags.nopervasives then objfiles
- else if !Clflags.output_c_object then "stdlib.cma" :: objfiles
- else "stdlib.cma" :: (objfiles @ ["std_exit.cmo"]) in
+ match
+ !Clflags.nopervasives,
+ !Clflags.output_c_object,
+ !Clflags.output_complete_executable
+ with
+ | true, _, _ -> objfiles
+ | false, true, false -> "stdlib.cma" :: objfiles
+ | _ -> "stdlib.cma" :: objfiles @ ["std_exit.cmo"]
+ in
let tolink = List.fold_right scan_file objfiles [] in
let missing_modules =
Ident.Set.filter (fun id -> not (Ident.is_predef id)) !missing_globals
fi
fi
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for OCaml 4.10.0.
+# Generated by GNU Autoconf 2.69 for OCaml 4.10.1.
#
# Report bugs to <caml-list@inria.fr>.
#
# Identity of this package.
PACKAGE_NAME='OCaml'
PACKAGE_TARNAME='ocaml'
-PACKAGE_VERSION='4.10.0'
-PACKAGE_STRING='OCaml 4.10.0'
+PACKAGE_VERSION='4.10.1'
+PACKAGE_STRING='OCaml 4.10.1'
PACKAGE_BUGREPORT='caml-list@inria.fr'
PACKAGE_URL='http://www.ocaml.org'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OCaml 4.10.0 to adapt to many kinds of systems.
+\`configure' configures OCaml 4.10.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OCaml 4.10.0:";;
+ short | recursive ) echo "Configuration of OCaml 4.10.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OCaml configure 4.10.0
+OCaml configure 4.10.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OCaml $as_me 4.10.0, which was
+It was created by OCaml $as_me 4.10.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.10.0" >&5
-$as_echo "$as_me: Configuring OCaml version 4.10.0" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.10.1" >&5
+$as_echo "$as_me: Configuring OCaml version 4.10.1" >&6;}
# Configuration variables
-VERSION=4.10.0
+VERSION=4.10.1
# Note: This is present for the flexdll bootstrap where it exposed as the old
msvc-*) :
outputobj=-Fo; gcc_warnings="" ;; #(
*) :
- outputobj='-o $(EMPTY)'; case 4.10.0 in #(
+ outputobj='-o $(EMPTY)'; case 4.10.1 in #(
*+dev*) :
gcc_warnings="-Wall -Werror" ;; #(
*) :
s390x,elf) :
default_as="${toolpref}as -m 64 -march=$model"
default_aspp="${toolpref}gcc -c -Wa,-march=$model" ;; #(
- arm,freebsd|arm64,freebsd) :
- default_as="${toolpref}cc -c"
- default_aspp="${toolpref}cc -c" ;; #(
- *,dragonfly) :
- default_as="${toolpref}as"
- default_aspp="${toolpref}cc -c" ;; #(
*,freebsd) :
+ default_as="${toolpref}cc -c -Wno-trigraphs"
+ default_aspp="${toolpref}cc -c -Wno-trigraphs" ;; #(
+ *,dragonfly) :
default_as="${toolpref}as"
default_aspp="${toolpref}cc -c" ;; #(
amd64,*|arm,*|arm64,*|i386,*) :
- default_as="${toolpref}as"
case $ocaml_cv_cc_vendor in #(
clang-*) :
- default_aspp="${toolpref}clang -c -Wno-trigraphs" ;; #(
+ default_as="${toolpref}clang -c -Wno-trigraphs"
+ default_aspp="${toolpref}clang -c -Wno-trigraphs" ;; #(
*) :
- default_aspp="${toolpref}gcc -c" ;;
+ default_as="${toolpref}as"
+ default_aspp="${toolpref}gcc -c" ;;
esac ;; #(
*) :
;;
if test -z "$BFD_LIB_DIR"; then :
BFD_LIB_DIR="/opt/local/lib"
fi ;; #(
- *-*openbsd*) :
+ *-*-openbsd*|*-*-freebsd*) :
if test -z "$BFD_INCLUDE_DIR"; then :
BFD_INCLUDE_DIR="/usr/local/include"
fi
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OCaml $as_me 4.10.0, which was
+This file was extended by OCaml $as_me 4.10.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-OCaml config.status 4.10.0
+OCaml config.status 4.10.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
[s390x,elf],
[default_as="${toolpref}as -m 64 -march=$model"
default_aspp="${toolpref}gcc -c -Wa,-march=$model"],
- [arm,freebsd|arm64,freebsd],
- [default_as="${toolpref}cc -c"
- default_aspp="${toolpref}cc -c"],
- [*,dragonfly],
- [default_as="${toolpref}as"
- default_aspp="${toolpref}cc -c"],
[*,freebsd],
+ [default_as="${toolpref}cc -c -Wno-trigraphs"
+ default_aspp="${toolpref}cc -c -Wno-trigraphs"],
+ [*,dragonfly],
[default_as="${toolpref}as"
default_aspp="${toolpref}cc -c"],
[amd64,*|arm,*|arm64,*|i386,*],
- [default_as="${toolpref}as"
- AS_CASE([$ocaml_cv_cc_vendor],
- [clang-*], [default_aspp="${toolpref}clang -c -Wno-trigraphs"],
- [default_aspp="${toolpref}gcc -c"])])
+ [AS_CASE([$ocaml_cv_cc_vendor],
+ [clang-*], [default_as="${toolpref}clang -c -Wno-trigraphs"
+ default_aspp="${toolpref}clang -c -Wno-trigraphs"],
+ [default_as="${toolpref}as"
+ default_aspp="${toolpref}gcc -c"])])
AS_IF([test "$with_pic"],
[fpic=true
[BFD_INCLUDE_DIR="/opt/local/include"])
AS_IF([test -z "$BFD_LIB_DIR"],
[BFD_LIB_DIR="/opt/local/lib"])],
- [*-*openbsd*],
+ [*-*-openbsd*|*-*-freebsd*],
[AS_IF([test -z "$BFD_INCLUDE_DIR"],
[BFD_INCLUDE_DIR="/usr/local/include"])
AS_IF([test -z "$BFD_LIB_DIR"],
consequence, they can only be referred by their short names.
%\vspace{0.1cm}
-\subsection{ss:builtin-types}*{Built-in types}
+\subsection*{ss:builtin-types}{Built-in types}
%\vspace{0.1cm}
\begin{ocamldoccode}
opam-version: "2.0"
-version: "4.10.0"
+version: "4.10.1"
synopsis: "OCaml development version"
depends: [
- "ocaml" {= "4.10.0" & post}
+ "ocaml" {= "4.10.1" & post}
"base-unix" {post}
"base-bigarray" {post}
"base-threads" {post}
COMPFLAGS=-absname -w +a-4-9-41-42-44-45-48 -warn-error A -bin-annot -g \
-safe-string -strict-sequence -strict-formats $(EXTRACAMLFLAGS)
ifeq "$(FLAMBDA)" "true"
-OPTCOMPFLAGS=-O3
-else
-OPTCOMPFLAGS=
-endif
-ifeq "$(FUNCTION_SECTIONS)" "true"
-OPTCOMPFLAGS += -function-sections
+OPTCOMPFLAGS += -O3
endif
MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlmklib
-warn-error A \
-bin-annot -safe-string -strict-formats
ifeq "$(FLAMBDA)" "true"
-OPTCOMPFLAGS=-O3
-else
-OPTCOMPFLAGS=
+OPTCOMPFLAGS += -O3
endif
COMPFLAGS += -I byte
MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlmklib
COMPFLAGS=-w +33..39 -warn-error A -g -bin-annot -safe-string
ifeq "$(FLAMBDA)" "true"
-OPTCOMPFLAGS=-O3
-else
-OPTCOMPFLAGS=
+OPTCOMPFLAGS += -O3
endif
LIBNAME=threads
$(ASPP) $(ASPPFLAGS) $(SHAREDLIB_CFLAGS) -o $@ $<
domain_state64.inc: caml/domain_state.tbl gen_domain_state64_inc.awk
- awk -f gen_domain_state64_inc.awk $< > $@
+ $(AWK) -f ./gen_domain_state64_inc.awk $< > $@
domain_state32.inc: caml/domain_state.tbl gen_domain_state32_inc.awk
- awk -f gen_domain_state32_inc.awk $< > $@
+ $(AWK) -f ./gen_domain_state32_inc.awk $< > $@
amd64nt.obj: amd64nt.asm domain_state64.inc
$(ASM)$@ $(ASMFLAGS) $<
CAMLassert(di->already_read == 0);
di->already_read = 1;
+ /* At the moment, bytecode programs built with --output-complete-exe
+ do not contain any debug info.
+
+ See https://github.com/ocaml/ocaml/issues/9344 for details.
+ */
+ if (caml_cds_file == NULL && caml_byte_program_mode == COMPLETE_EXE)
+ CAMLreturn0;
+
if (caml_cds_file != NULL) {
exec_name = caml_cds_file;
} else {
/* See [freelist.c] for usage info on these functions. */
extern header_t *(*caml_fl_p_allocate) (mlsize_t wo_sz);
extern void (*caml_fl_p_init_merge) (void);
-extern void (*caml_fl_p_reset) (void);
extern header_t *(*caml_fl_p_merge_block) (value bp, char *limit);
extern void (*caml_fl_p_add_blocks) (value bp);
extern void (*caml_fl_p_make_free_blocks)
static inline void caml_fl_init_merge (void)
{ (*caml_fl_p_init_merge) (); }
-static inline void caml_fl_reset (void)
- { (*caml_fl_p_reset) (); }
-
static inline header_t *caml_fl_merge_block (value bp, char *limit)
{ return (*caml_fl_p_merge_block) (bp, limit); }
{ (*caml_fl_p_make_free_blocks) (p, size, do_merge, color); }
extern void caml_set_allocation_policy (intnat);
+extern void caml_fl_reset_and_switch_policy (intnat);
#ifdef DEBUG
static inline void caml_fl_check (void)
/* we need to be able to compute the exact offset of each member. */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define CAMLalign(n) _Alignas(n)
+#elif defined(__cplusplus) && _MSC_VER >= 1900
+#define CAMLalign(n) alignas(n)
#elif defined(SUPPORTS_ALIGNED_ATTRIBUTE)
#define CAMLalign(n) __attribute__((aligned(n)))
#elif _MSC_VER >= 1500
extern int32_t caml_seek_section(int fd, struct exec_trailer *trail,
char *name);
+enum caml_byte_program_mode
+ {
+ STANDARD /* normal bytecode program requiring "ocamlrun" */,
+ COMPLETE_EXE /* embeding the vm, i.e. compiled with --output-complete-exe */
+ };
+
+extern enum caml_byte_program_mode caml_byte_program_mode;
+
#endif /* CAML_INTERNALS */
#endif /* CAML_STARTUP_H */
caml_heap_check ();
#endif
+ /* Make sure the heap is in the right state for compaction:
+ - all free blocks are blue
+ - all other blocks are white and contain valid pointers
+ */
+ caml_fl_reset_and_switch_policy (new_allocation_policy);
+
+
/* First pass: encode all noninfix headers. */
{
ch = caml_heap_start;
structures from scratch. */
{
ch = caml_heap_start;
- if (new_allocation_policy != -1){
- caml_set_allocation_policy (new_allocation_policy);
- }
- caml_fl_reset ();
+ caml_fl_init_merge ();
while (ch != NULL){
if (Chunk_size (ch) > Chunk_alloc (ch)){
caml_make_free_blocks ((value *) (ch + Chunk_alloc (ch)),
#endif
}
-static void nf_reset (void)
+static void nf_init (void)
{
Next_small (Nf_head) = Val_NULL;
nf_prev = Nf_head;
caml_fl_cur_wsz = 0;
- nf_init_merge ();
+}
+
+static void nf_reset (void)
+{
+ nf_init ();
}
/* Note: the [limit] parameter is unused because we merge blocks one by one. */
}
}
-static void ff_reset (void)
+static void ff_init (void)
{
Next_small (Ff_head) = Val_NULL;
ff_truncate_flp (Ff_head);
caml_fl_cur_wsz = 0;
- ff_init_merge ();
+}
+
+static void ff_reset (void)
+{
+ ff_init ();
}
/* Note: the [limit] parameter is unused because we merge blocks one by one. */
}
}
-static void bf_reset (void)
+static void bf_init (void)
{
mlsize_t i;
bf_large_tree = NULL;
bf_large_least = NULL;
caml_fl_cur_wsz = 0;
- bf_init_merge ();
+}
+
+/* Make sure all free blocks are blue and tear down the BF data structures. */
+static void bf_reset (void)
+{
+ mlsize_t i;
+
+ for (i = 1; i <= BF_NUM_SMALL; i++){
+ /* At the beginning of each small free list is a segment of remnants
+ that were pushed back to the list after splitting. These are white
+ and they are not in order. We must make them blue before we can
+ compact or change the allocator policy.
+ */
+ value p = bf_small_fl[i].free;
+ while (1){
+ if (p == Val_NULL || Color_val (p) == Caml_blue) break;
+ CAMLassert (Color_val (p) == Caml_white);
+ Hd_val (p) = Bluehd_hd (Hd_val (p));
+ p = Next_small (p);
+ }
+ }
+ /* We have no malloced data structures, so we can just call [bf_init] to
+ clear all our pointers. */
+ bf_init ();
}
static header_t *bf_merge_block (value bp, char *limit)
/* Initialize the merge_block machinery (at start of sweeping). */
void (*caml_fl_p_init_merge) (void) = &nf_init_merge;
-/* This is called by caml_compact_heap. */
-void (*caml_fl_p_reset) (void) = &nf_reset;
+/* These are called internally. */
+static void (*caml_fl_p_init) (void) = &nf_init;
+static void (*caml_fl_p_reset) (void) = &nf_reset;
/* [caml_fl_merge_block] returns the head pointer of the next block after [bp],
because merging blocks may change the size of [bp]. */
caml_fl_p_allocate = &nf_allocate;
caml_fl_p_init_merge = &nf_init_merge;
caml_fl_p_reset = &nf_reset;
+ caml_fl_p_init = &nf_init;
caml_fl_p_merge_block = &nf_merge_block;
caml_fl_p_add_blocks = &nf_add_blocks;
caml_fl_p_make_free_blocks = &nf_make_free_blocks;
caml_fl_p_allocate = &ff_allocate;
caml_fl_p_init_merge = &ff_init_merge;
caml_fl_p_reset = &ff_reset;
+ caml_fl_p_init = &ff_init;
caml_fl_p_merge_block = &ff_merge_block;
caml_fl_p_add_blocks = &ff_add_blocks;
caml_fl_p_make_free_blocks = &ff_make_free_blocks;
caml_fl_p_allocate = &bf_allocate;
caml_fl_p_init_merge = &bf_init_merge;
caml_fl_p_reset = &bf_reset;
+ caml_fl_p_init = &bf_init;
caml_fl_p_merge_block = &bf_merge_block;
caml_fl_p_add_blocks = &bf_add_blocks;
caml_fl_p_make_free_blocks = &bf_make_free_blocks;
break;
}
}
+
+/* This is called by caml_compact_heap. */
+void caml_fl_reset_and_switch_policy (intnat new_allocation_policy)
+{
+ /* reset the fl data structures */
+ (*caml_fl_p_reset) ();
+ if (new_allocation_policy != -1){
+ caml_set_allocation_policy (new_allocation_policy);
+ (*caml_fl_p_init) (); /* initialize the new allocation policy */
+ }
+}
? 0 : WRONG_MAGIC;
}
+enum caml_byte_program_mode caml_byte_program_mode = STANDARD;
+
int caml_attempt_open(char_os **name, struct exec_trailer *trail,
int do_open_script)
{
case $1 in
stdlib.cm[iox])
echo ' -nopervasives -no-alias-deps -w -49' \
- ' -pp "$AWK -f expand_module_aliases.awk"';;
+ ' -pp "$AWK -f ./expand_module_aliases.awk"';;
camlinternalOO.cmx) echo ' -inline 0 -afl-inst-ratio 0';;
camlinternalLazy.cmx) echo ' -afl-inst-ratio 0';;
# never instrument camlinternalOO or camlinternalLazy (PR#7725)
-g -warn-error A -bin-annot -nostdlib \
-safe-string -strict-formats
ifeq "$(FLAMBDA)" "true"
-OPTCOMPFLAGS=-O3
-else
-OPTCOMPFLAGS=
-endif
-ifeq "$(FUNCTION_SECTIONS)" "true"
-OPTCOMPFLAGS += -function-sections
+OPTCOMPFLAGS += -O3
endif
OPTCOMPILER=$(ROOTDIR)/ocamlopt
CAMLOPT=$(CAMLRUN) $(OPTCOMPILER)
depend:
$(CAMLDEP) $(DEPFLAGS) $(filter-out stdlib.%,$(wildcard *.mli *.ml)) \
> .depend.tmp
- $(CAMLDEP) $(DEPFLAGS) -pp "$(AWK) -f remove_module_aliases.awk" \
+ $(CAMLDEP) $(DEPFLAGS) -pp "$(AWK) -f ./remove_module_aliases.awk" \
stdlib.ml stdlib.mli >> .depend.tmp
sed -Ee \
's#(^| )(${subst ${SPACE},|,${UNPREFIXED_OBJS}})[.]#\1stdlib__\2.#g' \
(** Control whether the OCaml runtime system can emit warnings
on stderr. Currently, the only supported warning is triggered
when a channel created by [open_*] functions is finalized without
- being closed. Runtime warnings are enabled by default.
+ being closed. Runtime warnings are disabled by default.
@since 4.03.0 *)
.PHONY: report
report:
@if [ ! -f $(TESTLOG) ]; then echo "No $(TESTLOG) file."; exit 1; fi
- @awk -f summarize.awk < $(TESTLOG)
+ @$(AWK) -f ./summarize.awk < $(TESTLOG)
.PHONY: retry-list
retry-list:
.PHONY: retries
retries:
- @awk -v retries=1 -v max_retries=$(MAX_TESTSUITE_DIR_RETRIES) \
- -f summarize.awk < $(TESTLOG) > _retries
+ @$(AWK) -v retries=1 -v max_retries=$(MAX_TESTSUITE_DIR_RETRIES) \
+ -f ./summarize.awk < $(TESTLOG) > _retries
@test `cat _retries | wc -l` -eq 0 || $(MAKE) $(NO_PRINT) retry-list
@rm -f _retries
--- /dev/null
+(* TEST
+
+use_runtime = "false"
+
+* setup-ocamlc.byte-build-env
+** ocamlc.byte
+flags = "-w a -output-complete-exe -ccopt -I${ocamlsrcdir}/runtime"
+program = "github9344"
+*** run
+program = "sh ${test_source_directory}/github9344.sh"
+**** check-program-output
+*)
+
+raise Not_found
--- /dev/null
+Fatal error: exception Not_found
--- /dev/null
+#!/bin/sh
+export OCAMLRUNPARAM=b=1
+./github9344 || true
value caml_puts(value s)
{
puts(String_val(s));
+ fflush(stdout);
return Val_unit;
}
external puts: string -> unit = "caml_puts"
+let _ = at_exit (fun () -> print_endline "Program terminated")
+
let () =
Unix.putenv "FOO" "Hello OCaml!";
puts (Unix.getenv "FOO")
Hello OCaml!
+Program terminated
# Setup GNU make variables storing per-target source and target,
# a list of installed tools, and a function to quote a filename for
# the shell.
-override installed_tools := ocamldep ocamlprof ocamlcp \
+override installed_tools := ocamldep ocamlprof ocamlcp ocamloptp \
ocamlmktop ocamlmklib ocamlobjinfo
install_files :=
main_args.cmo
$(call byte_and_opt,ocamlcp,$(ocamlcp_cmos) ocamlcp.cmo,)
+$(call byte_and_opt,ocamloptp,$(ocamlcp_cmos) ocamloptp.cmo,)
opt:: profiling.cmx
)\r
\r
cd "%APPVEYOR_BUILD_FOLDER%"\r
-appveyor DownloadFile "https://github.com/alainfrisch/flexdll/archive/0.37.tar.gz" -FileName "flexdll.tar.gz" || exit /b 1\r
-appveyor DownloadFile "https://github.com/alainfrisch/flexdll/releases/download/0.37/flexdll-bin-0.37.zip" -FileName "flexdll.zip" || exit /b 1\r
+appveyor DownloadFile "https://github.com/alainfrisch/flexdll/archive/%FLEXDLL_VERSION%.tar.gz" -FileName "flexdll.tar.gz" || exit /b 1\r
+appveyor DownloadFile "https://github.com/alainfrisch/flexdll/releases/download/%FLEXDLL_VERSION%/flexdll-bin-%FLEXDLL_VERSION%.zip" -FileName "flexdll.zip" || exit /b 1\r
rem flexdll.zip is processed here, rather than in appveyor_build.sh because the\r
rem unzip command comes from MSYS2 (via Git for Windows) and it has to be\r
rem invoked via cmd /c in a bash script which is weird(er).\r