-OCaml 4.09.0
-------------
+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)
+ (David Allsopp, report by Thomas Leonard)
+
+- #8947, #9134, #9302: fix/improve support for the BFD library
+ (Sébastien Hinderer, review by Damien Doligez and David Allsopp)
+
+- #8953, #8954: Fix error submessages in the toplevel: do not display
+ dummy locations
+ (Armaël Guéneau, review by Gabriel Scherer)
+
+- #8965, #8979: Alpine build failure caused by check-parser-uptodate-or-warn.sh
+ (Gabriel Scherer and David Allsopp, report by Anton Kochkov)
+
+- #8985, #8986: fix generation of the primitives when the locale collation is
+ incompatible with C.
+ (David Allsopp, review by Nicolás Ojeda Bär, report by Sebastian Rasmussen)
+
+- #9050, #9076: install missing compilerlibs/ocamlmiddleend archives
+ (Gabriel Scherer, review by Florian Angeletti, report by Olaf Hering)
+
+- #9073, #9120: fix incorrect GC ratio multiplier when allocating custom blocks
+ with caml_alloc_custom_mem in runtime/custom.c
+ (Markus Mottl, review by Gabriel Scherer and Damien Doligez)
+
+- #9144, #9180: multiple definitions of global variables in the C runtime,
+ causing problems with GCC 10.0 and possibly with other C compilers
+ (Xavier Leroy, report by Jürgen Reuter, review by Mark Shinwell)
+
+- #9180: pass -fno-common option to C compiler when available,
+ so as to detect problematic multiple definitions of global variables
+ in the C runtime
+ (Xavier Leroy, review by Mark Shinwell)
+
+- #9128: Fix a bug in bytecode mode which could lead to a segmentation
+ fault. The bug was caused by the fact that the atom table shared a
+ page with some bytecode. The fix makes sure both the atom table and
+ the minor heap have their own pages.
+ (Jacques-Henri Jourdan, review by Stephen Dolan, Xavier Leroy and
+ Gabriel Scherer)
+
+OCaml 4.09.0 (19 September 2019):
+---------------------------------
(Changes that can break existing programs are marked with a "*")
utils/config.ml: utils/config.mlp Makefile.config utils/Makefile Makefile
$(MAKE) -C utils config.ml
-ifeq "$(UNIX_OR_WIN32)" "unix"
.PHONY: reconfigure
reconfigure:
./configure $(CONFIGURE_ARGS)
-endif
.PHONY: partialclean
partialclean::
"$(INSTALL_COMPLIBDIR)"
endif
$(INSTALL_DATA) \
- compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
- compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) \
+ compilerlibs/*.cma \
+ "$(INSTALL_COMPLIBDIR)"
+ $(INSTALL_DATA) \
+ $(BYTESTART) $(TOPLEVELSTART) \
"$(INSTALL_COMPLIBDIR)"
$(INSTALL_PROG) expunge "$(INSTALL_LIBDIR)/expunge$(EXE)"
$(INSTALL_DATA) \
"$(INSTALL_COMPLIBDIR)"
endif
$(INSTALL_DATA) \
- compilerlibs/ocamloptcomp.cma $(OPTSTART) \
+ $(OPTSTART) \
"$(INSTALL_COMPLIBDIR)"
if test -n "$(WITH_OCAMLDOC)"; then \
$(MAKE) -C ocamldoc installopt; \
asmcomp/debug/*.cmx \
"$(INSTALL_COMPLIBDIR)"
$(INSTALL_DATA) \
- compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A) \
- compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A) \
- compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A) \
+ compilerlibs/*.cmxa compilerlibs/*.$(A) \
+ "$(INSTALL_COMPLIBDIR)"
+ $(INSTALL_DATA) \
$(BYTESTART:.cmo=.cmx) $(BYTESTART:.cmo=.$(O)) \
$(OPTSTART:.cmo=.cmx) $(OPTSTART:.cmo=.$(O)) \
"$(INSTALL_COMPLIBDIR)"
toplevel/opttopdirs.cmi \
"$(INSTALL_LIBDIR)"; \
$(INSTALL_DATA) \
- compilerlibs/ocamlopttoplevel.cmxa \
- compilerlibs/ocamlopttoplevel.$(A) \
$(OPTTOPLEVELSTART:.cmo=.cmx) $(OPTTOPLEVELSTART:.cmo=.$(O)) \
"$(INSTALL_COMPLIBDIR)"; \
fi
parsing/parser.ml: boot/menhir/parser.ml parsing/parser.mly \
tools/check-parser-uptodate-or-warn.sh
- @tools/check-parser-uptodate-or-warn.sh
- cat $< | sed "s/MenhirLib/CamlinternalMenhirLib/g" > $@
+ @-tools/check-parser-uptodate-or-warn.sh
+ sed "s/MenhirLib/CamlinternalMenhirLib/g" $< > $@
parsing/parser.mli: boot/menhir/parser.mli
- cat $< | sed "s/MenhirLib/CamlinternalMenhirLib/g" > $@
+ sed "s/MenhirLib/CamlinternalMenhirLib/g" $< > $@
partialclean:: partialclean-menhir
ocamlc_cmd = $(FLEXLINK_ENV) $(ocamlc)
ocamlopt_cmd = $(FLEXLINK_ENV) $(ocamlopt)
endif
+
+# The rule to compile C files
+
+# This rule is similar to GNU make's implicit rule, except that it is more
+# general (it supports both .o and .obj)
+
+%.$(O): %.c
+ $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
UNIX_OR_WIN32=@unix_or_win32@
UNIXLIB=@unixlib@
-LIBBFD_LINK=@libbfd_link@
-LIBBFD_INCLUDE=@libbfd_include@
+BFD_CPPFLAGS=@bfd_cppflags@
+BFD_LDFLAGS=@bfd_ldflags@
+BFD_LDLIBS=@bfd_ldlibs@
INSTALL_SOURCE_ARTIFACTS=@install_source_artifacts@
OC_CFLAGS=@oc_cflags@
-4.09.0
+4.09.1
# The version string is the first line of this file.
# It must be in the format described in stdlib/sys.mli
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for OCaml 4.09.0.
+# Generated by GNU Autoconf 2.69 for OCaml 4.09.1+dev1-2020-03-13.
#
# Report bugs to <caml-list@inria.fr>.
#
# Identity of this package.
PACKAGE_NAME='OCaml'
PACKAGE_TARNAME='ocaml'
-PACKAGE_VERSION='4.09.0'
-PACKAGE_STRING='OCaml 4.09.0'
+PACKAGE_VERSION='4.09.1+dev1-2020-03-13'
+PACKAGE_STRING='OCaml 4.09.1+dev1-2020-03-13'
PACKAGE_BUGREPORT='caml-list@inria.fr'
PACKAGE_URL='http://www.ocaml.org'
LD
DEFAULT_STRING
WINDOWS_UNICODE_MODE
+BFD_LIB_DIR
+BFD_INCLUDE_DIR
LIBUNWIND_LIB_DIR
LIBUNWIND_INCLUDE_DIR
DLLIBS
asm_cfi_supported
AS
ASPP
-libbfd_link
-libbfd_include
+bfd_ldlibs
+bfd_ldflags
+bfd_cppflags
x_libraries
x_includes
pthread_link
enable_vmthreads
enable_systhreads
with_libunwind
+with_bfd
enable_graph_lib
enable_str_lib
enable_unix_lib
DLLIBS
LIBUNWIND_INCLUDE_DIR
LIBUNWIND_LIB_DIR
+BFD_INCLUDE_DIR
+BFD_LIB_DIR
WINDOWS_UNICODE_MODE
DEFAULT_STRING
CC
# 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.09.0 to adapt to many kinds of systems.
+\`configure' configures OCaml 4.09.1+dev1-2020-03-13 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.09.0:";;
+ short | recursive ) echo "Configuration of OCaml 4.09.1+dev1-2020-03-13:";;
esac
cat <<\_ACEOF
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-libunwind disable libunwind support for Spacetime profiling
+ --without-bfd disable BFD (Binary File Description) library
+ support
--with-target-bindir location of binary programs on target system
--with-afl use the AFL fuzzer
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
location of header files for libunwind
LIBUNWIND_LIB_DIR
location of library files for libunwind
+ BFD_INCLUDE_DIR
+ location of header files for the BFD library
+ BFD_LIB_DIR location of library files for the BFD library
WINDOWS_UNICODE_MODE
how to handle Unicode under Windows: ansi, compatible
DEFAULT_STRING
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OCaml configure 4.09.0
+OCaml configure 4.09.1+dev1-2020-03-13
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.09.0, which was
+It was created by OCaml $as_me 4.09.1+dev1-2020-03-13, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.09.0" >&5
-$as_echo "$as_me: Configuring OCaml version 4.09.0" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring OCaml version 4.09.1+dev1-2020-03-13" >&5
+$as_echo "$as_me: Configuring OCaml version 4.09.1+dev1-2020-03-13" >&6;}
# Configuration variables
## Output variables
-VERSION=4.09.0
+VERSION=4.09.1+dev1-2020-03-13
# Note: This is present for the flexdll bootstrap where it exposed as the old
+
## Generated files
+
+# Check whether --with-bfd was given.
+if test "${with_bfd+set}" = set; then :
+ withval=$with_bfd;
+else
+ with_bfd=auto
+fi
+
+
+
+
+
+
# Check whether --enable-graph-lib was given.
if test "${enable_graph_lib+set}" = set; then :
enableval=$enable_graph_lib; as_fn_error $? "The graphics library is no longer distributed with OCaml \
msvc-*) :
outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings="" ;; #(
*) :
- outputobj='-o $(EMPTY)'; case 4.09.0 in #(
+ outputobj='-o $(EMPTY)'; case 4.09.1+dev1-2020-03-13 in #(
*+dev*) :
gcc_warnings="-Wall -Werror" ;; #(
*) :
case $ocaml_cv_cc_vendor in #(
clang-*) :
common_cflags="-O2 -fno-strict-aliasing -fwrapv";
- internal_cflags="$gcc_warnings" ;; #(
+ internal_cflags="$gcc_warnings -fno-common" ;; #(
gcc-012-*) :
# Some versions known to miscompile OCaml, e,g, 2.7.2.1, some 2.96.
# Plus: C99 support unknown.
internal_cflags="$gcc_warnings" ;; #(
gcc-*) :
common_cflags="-O2 -fno-strict-aliasing -fwrapv";
- internal_cflags="$gcc_warnings" ;; #(
+ internal_cflags="$gcc_warnings -fno-common" ;; #(
msvc-*) :
common_cflags="-nologo -O2 -Gy- -MD"
common_cppflags="-D_CRT_SECURE_NO_DEPRECATE"
esac
fi
-## libbfd
+## BFD (Binary File Description) library
+
+bfd_cppflags=""
+bfd_ldflags=""
+bfd_ldlibs=""
-ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
+if test x"$with_bfd" != "xno"; then :
+ bfd_available=false
+ case $host in #(
+ x86_64-*-darwin*) :
+ if test -z "$BFD_INCLUDE_DIR"; then :
+ BFD_INCLUDE_DIR="/opt/local/include"
+fi
+ if test -z "$BFD_LIB_DIR"; then :
+ BFD_LIB_DIR="/opt/local/lib"
+fi ;; #(
+ *-*openbsd*) :
+ if test -z "$BFD_INCLUDE_DIR"; then :
+ BFD_INCLUDE_DIR="/usr/local/include"
+fi
+ if test -z "$BFD_LIB_DIR"; then :
+ BFD_LIB_DIR="/usr/local/lib"
+fi ;; #(
+ *) :
+ ;;
+esac
+ if test -n "$BFD_INCLUDE_DIR"; then :
+ bfd_cppflags="-I$BFD_INCLUDE_DIR"
+fi
+ if test -n "$BFD_LIB_DIR"; then :
+ bfd_ldflags="-L$BFD_LIB_DIR"
+fi
+ SAVED_CPPFLAGS="$CPPFLAGS"
+ SAVED_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $bfd_cppflags"
+ LDFLAGS="$LDFLAGS $bfd_ldflags"
+ ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
if test "x$ac_cv_header_bfd_h" = xyes; then :
- libbfd_ling=""
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
+ bfd_ldlibs=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
if ${ac_cv_lib_bfd_bfd_openr+:} false; then :
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5
$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :
- libbfd_link="-lbfd"
+ bfd_ldlibs="-lbfd"
fi
- if test -z "$libbfd_link"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
+ if test -z "$bfd_ldlibs"; then :
+ unset ac_cv_lib_bfd_bfd_openr
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
if ${ac_cv_lib_bfd_bfd_openr+:} false; then :
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5
$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :
- libbfd_link="-lbfd -ldl"
+ bfd_ldlibs="-lbfd -ldl"
fi
fi
- if test -z "$libbfd_link"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
+ if test -z "$bfd_ldlibs"; then :
+ unset ac_cv_lib_bfd_bfd_openr
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
if ${ac_cv_lib_bfd_bfd_openr+:} false; then :
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5
$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :
- libbfd_link="-lbfd -ldl -liberty"
+ bfd_ldlibs="-lbfd -ldl -liberty"
fi
fi
- if test -z "$libbfd_link"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
+ if test -z "$bfd_ldlibs"; then :
+ unset ac_cv_lib_bfd_bfd_openr
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
if ${ac_cv_lib_bfd_bfd_openr+:} false; then :
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5
$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :
- libbfd_link="-lbfd -ldl -liberty -lz"
+ bfd_ldlibs="-lbfd -ldl -liberty -lz"
fi
fi
- if test -z "$libbfd_link"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
+ if test -z "$bfd_ldlibs"; then :
+ unset ac_cv_lib_bfd_bfd_openr
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
if ${ac_cv_lib_bfd_bfd_openr+:} false; then :
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5
$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :
- libbfd_link="-lbfd -ldl -liberty -lz -lintl"
+ bfd_ldlibs="-lbfd -ldl -liberty -lz -lintl"
fi
fi
- if test -n "$libbfd_link"; then :
- $as_echo "#define HAS_LIBBFD 1" >>confdefs.h
+ if test -n "$bfd_ldlibs"; then :
+ bfd_available=true
+ $as_echo "#define HAS_LIBBFD 1" >>confdefs.h
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: BFD library not found, 'objinfo' will be unable to display info on .cmxs files." >&5
-$as_echo "$as_me: BFD library not found, 'objinfo' will be unable to display info on .cmxs files." >&6;}
fi
-
fi
+ if ! $bfd_available; then :
+ if test x"$with_bfd" = "xyes"; then :
+ as_fn_error $? "BFD library support requested but not available" "$LINENO" 5
+else
+ bfd_cppflags=""
+ bfd_ldflags=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: BFD library not found, 'ocamlobjinfo' will be unable to display info on .cmxs files." >&5
+$as_echo "$as_me: BFD library not found, 'ocamlobjinfo' will be unable to display info on .cmxs files." >&6;}
+fi
+fi
+ LDFLAGS="$SAVED_LDFLAGS"
+ CPP_FLAGS="$SAVED_CPPFLAGS"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Support for the BFD (Binary File Description) library disabled, 'ocamlobjinfo' will be unable to display info on .cmxs files." >&5
+$as_echo "$as_me: Support for the BFD (Binary File Description) library disabled, 'ocamlobjinfo' will be unable to display info on .cmxs files." >&6;}
+fi
## Does the assembler support debug prefix map and CFI directives
as_has_debug_prefix_map=false
# 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.09.0, which was
+This file was extended by OCaml $as_me 4.09.1+dev1-2020-03-13, 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.09.0
+OCaml config.status 4.09.1+dev1-2020-03-13
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
AC_SUBST([pthread_link])
AC_SUBST([x_includes])
AC_SUBST([x_libraries])
-AC_SUBST([libbfd_include])
-AC_SUBST([libbfd_link])
+AC_SUBST([bfd_cppflags])
+AC_SUBST([bfd_ldflags])
+AC_SUBST([bfd_ldlibs])
AC_SUBST([ASPP])
AC_SUBST([AS])
AC_SUBST([asm_cfi_supported])
AC_ARG_VAR([LIBUNWIND_LIB_DIR],
[location of library files for libunwind])
+AC_ARG_WITH([bfd],
+ [AS_HELP_STRING([--without-bfd],
+ [disable BFD (Binary File Description) library support])],
+ [],
+ [with_bfd=auto])
+
+AC_ARG_VAR([BFD_INCLUDE_DIR],
+ [location of header files for the BFD library])
+
+AC_ARG_VAR([BFD_LIB_DIR],
+ [location of library files for the BFD library])
+
AC_ARG_ENABLE([graph-lib], [],
[AC_MSG_ERROR([The graphics library is no longer distributed with OCaml \
since version 4.09. It is now distributed as a separate "graphics" package: \
[AS_CASE([$ocaml_cv_cc_vendor],
[clang-*],
[common_cflags="-O2 -fno-strict-aliasing -fwrapv";
- internal_cflags="$gcc_warnings"],
+ internal_cflags="$gcc_warnings -fno-common"],
[gcc-[012]-*],
# Some versions known to miscompile OCaml, e,g, 2.7.2.1, some 2.96.
# Plus: C99 support unknown.
internal_cflags="$gcc_warnings"],
[gcc-*],
[common_cflags="-O2 -fno-strict-aliasing -fwrapv";
- internal_cflags="$gcc_warnings"],
+ internal_cflags="$gcc_warnings -fno-common"],
[msvc-*],
[common_cflags="-nologo -O2 -Gy- -MD"
common_cppflags="-D_CRT_SECURE_NO_DEPRECATE"
[systhread_support=false
AC_MSG_NOTICE([the POSIX threads library is not supported])])])])])
-## libbfd
-
-AC_CHECK_HEADER([bfd.h],
- [libbfd_ling=""
- AC_CHECK_LIB([bfd], [bfd_openr], [libbfd_link="-lbfd"])
- AS_IF([test -z "$libbfd_link"],
- [AC_CHECK_LIB([bfd], [bfd_openr], [libbfd_link="-lbfd -ldl"], [], [-ldl])])
- AS_IF([test -z "$libbfd_link"],
- [AC_CHECK_LIB([bfd], [bfd_openr],
- [libbfd_link="-lbfd -ldl -liberty"], [], [-ldl -liberty])])
- AS_IF([test -z "$libbfd_link"],
- [AC_CHECK_LIB([bfd], [bfd_openr],
- [libbfd_link="-lbfd -ldl -liberty -lz"], [], [-ldl -liberty -lz])])
- AS_IF([test -z "$libbfd_link"],
- [AC_CHECK_LIB([bfd], [bfd_openr],
- [libbfd_link="-lbfd -ldl -liberty -lz -lintl"], [],
- [-ldl -liberty -lz -lintl])])
- AS_IF([test -n "$libbfd_link"],
- [AC_DEFINE([HAS_LIBBFD])],
- [AC_MSG_NOTICE(m4_normalize([
- BFD library not found, 'objinfo' will be unable to display
- info on .cmxs files.
+## BFD (Binary File Description) library
+
+bfd_cppflags=""
+bfd_ldflags=""
+bfd_ldlibs=""
+
+AS_IF([test x"$with_bfd" != "xno"],
+ [bfd_available=false
+ AS_CASE([$host],
+ [x86_64-*-darwin*],
+ [AS_IF([test -z "$BFD_INCLUDE_DIR"],
+ [BFD_INCLUDE_DIR="/opt/local/include"])
+ AS_IF([test -z "$BFD_LIB_DIR"],
+ [BFD_LIB_DIR="/opt/local/lib"])],
+ [*-*openbsd*],
+ [AS_IF([test -z "$BFD_INCLUDE_DIR"],
+ [BFD_INCLUDE_DIR="/usr/local/include"])
+ AS_IF([test -z "$BFD_LIB_DIR"],
+ [BFD_LIB_DIR="/usr/local/lib"])])
+ AS_IF([test -n "$BFD_INCLUDE_DIR"],
+ [bfd_cppflags="-I$BFD_INCLUDE_DIR"])
+ AS_IF([test -n "$BFD_LIB_DIR"],
+ [bfd_ldflags="-L$BFD_LIB_DIR"])
+ SAVED_CPPFLAGS="$CPPFLAGS"
+ SAVED_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $bfd_cppflags"
+ LDFLAGS="$LDFLAGS $bfd_ldflags"
+ AC_CHECK_HEADER([bfd.h],
+ [bfd_ldlibs=""
+ AC_CHECK_LIB([bfd], [bfd_openr], [bfd_ldlibs="-lbfd"])
+ AS_IF([test -z "$bfd_ldlibs"],
+ [unset ac_cv_lib_bfd_bfd_openr
+ AC_CHECK_LIB([bfd], [bfd_openr],
+ [bfd_ldlibs="-lbfd -ldl"], [], [-ldl])])
+ AS_IF([test -z "$bfd_ldlibs"],
+ [unset ac_cv_lib_bfd_bfd_openr
+ AC_CHECK_LIB([bfd], [bfd_openr],
+ [bfd_ldlibs="-lbfd -ldl -liberty"], [], [-ldl -liberty])])
+ AS_IF([test -z "$bfd_ldlibs"],
+ [unset ac_cv_lib_bfd_bfd_openr
+ AC_CHECK_LIB([bfd], [bfd_openr],
+ [bfd_ldlibs="-lbfd -ldl -liberty -lz"], [], [-ldl -liberty -lz])])
+ AS_IF([test -z "$bfd_ldlibs"],
+ [unset ac_cv_lib_bfd_bfd_openr
+ AC_CHECK_LIB([bfd], [bfd_openr],
+ [bfd_ldlibs="-lbfd -ldl -liberty -lz -lintl"], [],
+ [-ldl -liberty -lz -lintl])])
+ AS_IF([test -n "$bfd_ldlibs"],
+ [bfd_available=true
+ AC_DEFINE([HAS_LIBBFD])])])
+ AS_IF([! $bfd_available],
+ [AS_IF([test x"$with_bfd" = "xyes"],
+ [AC_MSG_ERROR([BFD library support requested but not available])],
+ [bfd_cppflags=""
+ bfd_ldflags=""
+ AC_MSG_NOTICE(m4_normalize([
+ BFD library not found, 'ocamlobjinfo' will be unable to display
+ info on .cmxs files.
+ ]))])])
+ LDFLAGS="$SAVED_LDFLAGS"
+ CPP_FLAGS="$SAVED_CPPFLAGS"],
+ [AC_MSG_NOTICE(m4_normalize([
+ Support for the BFD (Binary File Description) library disabled,
+ 'ocamlobjinfo' will be unable to display info on .cmxs files.
]))])
- ])
## Does the assembler support debug prefix map and CFI directives
as_has_debug_prefix_map=false
opam-version: "2.0"
-version: "4.09.0"
+version: "4.09.1"
synopsis: "OCaml development version"
depends: [
- "ocaml" {= "4.09.0" & post}
+ "ocaml" {= "4.09.1" & post}
"base-unix" {post}
"base-bigarray" {post}
"base-threads" {post}
in
let pp_main_loc _ _ _ _ = () in
let pp_submsg_loc _ _ ppf loc =
- Format.fprintf ppf "%a:@ " print_loc loc in
+ if not loc.loc_ghost then
+ Format.fprintf ppf "%a:@ " print_loc loc in
{ batch_mode_printer with pp; pp_main_loc; pp_submsg_loc }
let best_toplevel_printer () =
#include "caml/backtrace_prim.h"
#include "caml/fail.h"
-/* The table of debug information fragments */
-struct ext_table caml_debug_info;
-
CAMLexport int32_t caml_backtrace_active = 0;
CAMLexport int32_t caml_backtrace_pos = 0;
CAMLexport backtrace_slot * caml_backtrace_buffer = NULL;
caml_stat_compactions,
caml_stat_heap_chunks;
-uintnat caml_normalize_heap_increment (uintnat);
-
/*
minor_size: cf. minor_heap_size in gc.mli
major_size: Size in words of the initial major heap
/* 3- Atoms are 0-tuples. They are statically allocated once and for all. */
-CAMLextern header_t caml_atom_table[];
+CAMLextern header_t *caml_atom_table;
#define Atom(tag) (Val_hp (&(caml_atom_table [(tag)])))
/* Booleans are integers 0 or 1 */
{
mlsize_t mem_minor =
mem < caml_custom_minor_max_bsz ? mem : caml_custom_minor_max_bsz;
- return alloc_custom_gen (ops, bsz, mem,
- Bsize_wsize (caml_stat_heap_wsz) / 150
- * caml_custom_major_ratio,
- mem_minor,
- Bsize_wsize (caml_minor_heap_wsz) / 100
- * caml_custom_major_ratio);
+ mlsize_t max_major =
+ /* The major ratio is a percentage relative to the major heap size.
+ A complete GC cycle will be done every time 2/3 of that much memory
+ is allocated for blocks in the major heap. Assuming constant
+ allocation and deallocation rates, this means there are at most
+ [M/100 * major-heap-size] bytes of floating garbage at any time.
+ The reason for a factor of 2/3 (or 1.5) is, roughly speaking, because
+ the major GC takes 1.5 cycles (previous cycle + marking phase) before
+ it starts to deallocate dead blocks allocated during the previous cycle.
+ [heap_size / 150] is really [heap_size * (2/3) / 100] (but faster). */
+ Bsize_wsize (caml_stat_heap_wsz) / 150 * caml_custom_major_ratio;
+ mlsize_t max_minor =
+ Bsize_wsize (caml_minor_heap_wsz) / 100 * caml_custom_minor_ratio;
+ return alloc_custom_gen (ops, bsz, mem, max_major, mem_minor, max_minor);
}
struct custom_operations_list {
static intnat norm_minsize (intnat s)
{
+ intnat page_wsize = Wsize_bsize(Page_size);
if (s < Minor_heap_min) s = Minor_heap_min;
if (s > Minor_heap_max) s = Minor_heap_max;
+ /* PR#9128 : Make sure the minor heap occupies an integral number of
+ pages, so that no page contains both bytecode and OCaml
+ values. This would confuse, e.g., caml_hash. */
+ s = (s + page_wsize - 1) / page_wsize * page_wsize;
return s;
}
return Val_long ((long) (caml_major_work_credit * 1e6));
}
-uintnat caml_normalize_heap_increment (uintnat i)
-{
- if (i < Bsize_wsize (Heap_chunk_min)){
- i = Bsize_wsize (Heap_chunk_min);
- }
- return ((i + Page_size - 1) >> Page_log) << Page_log;
-}
-
/* [minor_size] and [major_size] are numbers of words
[major_incr] is either a percentage or a number of words */
void caml_init_gc (uintnat minor_size, uintnat major_size,
uintnat custom_maj, uintnat custom_min,
uintnat custom_bsz)
{
- uintnat major_heap_size =
- Bsize_wsize (caml_normalize_heap_increment (major_size));
+ uintnat major_bsize;
+ if (major_size < Heap_chunk_min) major_size = Heap_chunk_min;
+ major_bsize = Bsize_wsize(major_size);
+ major_bsize = ((major_bsize + Page_size - 1) >> Page_log) << Page_log;
caml_instr_init ();
if (caml_init_alloc_for_heap () != 0){
caml_fatal_error ("cannot initialize heap: mmap failed");
}
- if (caml_page_table_initialize(Bsize_wsize(minor_size) + major_heap_size)){
+ if (caml_page_table_initialize(Bsize_wsize(minor_size) + major_bsize)){
caml_fatal_error ("cannot initialize page table");
}
caml_set_minor_heap_size (Bsize_wsize (norm_minsize (minor_size)));
caml_major_heap_increment = major_incr;
caml_percent_free = norm_pfree (percent_fr);
caml_percent_max = norm_pmax (percent_m);
- caml_init_major_heap (major_heap_size);
+ caml_init_major_heap (major_bsize);
caml_major_window = norm_window (window);
caml_custom_major_ratio = norm_custom_maj (custom_maj);
caml_custom_minor_ratio = norm_custom_min (custom_min);
caml_minor_heap_wsz / 1024);
caml_gc_message (0x20, "Initial major heap size: %"
ARCH_INTNAT_PRINTF_FORMAT "uk bytes\n",
- major_heap_size / 1024);
+ major_bsize / 1024);
caml_gc_message (0x20, "Initial space overhead: %"
ARCH_INTNAT_PRINTF_FORMAT "u%%\n", caml_percent_free);
caml_gc_message (0x20, "Initial max overhead: %"
# duplicated from $(ROOTDIR)/runtime/Makefile
+# #8985: the meaning of character range a-z depends on the locale, so force C
+# locale throughout.
+export LC_ALL=C
(
for prim in \
alloc array compare extern floats gc_ctrl hash intern interp ints io \
done
sed -n -e 's/^CAMLprim_int64_[0-9](\([a-z0-9_][a-z0-9_]*\)).*/caml_int64_\1\
caml_int64_\1_native/p' ints.c
-) | LC_ALL=C sort | uniq
+) | sort | uniq
Alloc_small(accu, num_args + 2, Closure_tag);
Field(accu, 1) = env;
for (i = 0; i < num_args; i++) Field(accu, i + 2) = sp[i];
+ CAMLassert(!Is_in_value_area(pc-3));
Code_val(accu) = pc - 3; /* Point to the preceding RESTART instr. */
sp += num_args;
pc = (code_t)(sp[0]);
}
/* The code pointer is not in the heap, so no need to go through
caml_initialize. */
+ CAMLassert(!Is_in_value_area(pc + *pc));
Code_val(accu) = pc + *pc;
pc++;
sp += nvars;
CAMLassert (bsz >= Bsize_wsize(Minor_heap_min));
CAMLassert (bsz <= Bsize_wsize(Minor_heap_max));
+ CAMLassert (bsz % Page_size == 0);
CAMLassert (bsz % sizeof (value) == 0);
if (caml_young_ptr != caml_young_alloc_end){
CAML_INSTR_INT ("force_minor/set_minor_heap_size@", 1);
#include "caml/startup_aux.h"
-/* Initialize the atom table */
+CAMLexport header_t *caml_atom_table = NULL;
-CAMLexport header_t caml_atom_table[256];
+/* Initialize the atom table */
void caml_init_atom_table(void)
{
+ caml_stat_block b;
int i;
+
+ /* PR#9128: We need to give the atom table its own page to make sure
+ it does not share a page with a non-value, which would break code
+ which depend on the correctness of the page table. For example,
+ if the atom table shares a page with bytecode, then functions in
+ the runtime may decide to follow a code pointer in a closure, as
+ if it were a pointer to a value.
+
+ We add 1 padding at the end of the atom table because the atom
+ pointer actually points to the word *following* the corresponding
+ entry in the table (the entry is an empty block *header*).
+ */
+ asize_t request = (256 + 1) * sizeof(header_t);
+ request = (request + Page_size - 1) / Page_size * Page_size;
+ caml_atom_table =
+ caml_stat_alloc_aligned_noexc(request, 0, &b);
+
for(i = 0; i < 256; i++) {
#ifdef NATIVE_CODE
caml_atom_table[i] = Make_header_allocated_here(0, i, Caml_white);
#endif
}
if (caml_page_table_add(In_static_data,
- caml_atom_table, caml_atom_table + 256) != 0) {
+ caml_atom_table, caml_atom_table + 256 + 1) != 0) {
caml_fatal_error("not enough memory for initial page table");
}
}
#endif
extern int caml_parser_trace;
-CAMLexport header_t caml_atom_table[256];
char * caml_code_area_start, * caml_code_area_end;
struct ext_table caml_code_fragments_table;
do \
if test -f "$$i".opt; then \
$(INSTALL_PROG) "$$i.opt" "$(INSTALL_BINDIR)/$$i.opt$(EXE)"; \
+ (cd "$(INSTALL_BINDIR)/" && $(LN) "$$i.opt$(EXE)" "$$i$(EXE)"); \
fi; \
done
endif
DEF_SYMBOL_PREFIX = '-Dsymbol_prefix=""'
endif
-objinfo_helper$(EXE): objinfo_helper.c $(ROOTDIR)/runtime/caml/s.h
- $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \
- $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK)
+objinfo_helper$(EXE): objinfo_helper.$(O)
+ $(CC) $(BFD_LDFLAGS) $(OC_CFLAGS) $(OUTPUTEXE)$@ $< $(BFD_LDLIBS)
+
+objinfo_helper.$(O): $(ROOTDIR)/runtime/caml/s.h
+
+objinfo_helper.$(O): \
+ OC_CPPFLAGS += -I$(ROOTDIR)/runtime $(DEF_SYMBOL_PREFIX) $(BFD_CPPFLAGS)
OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \
$(ROOTDIR)/compilerlibs/ocamlbytecomp.cma \
#* *
#**************************************************************************
+# stop early if we are not on a development version
+grep -Fq '+dev' VERSION || exit 0
+
# We try to warn if the user edits parsing/parser.mly but forgets to
# rebuild the generated parser. Our heuristic is to use the file
# modification timestamp, but just testing
# seconds after boot/menhir/parser.ml.
# mtime(): access a file's last modification time as a timestamp,
-# using either GNU coreutils' stat --format, or BSD/macos stat -f.
+# using either
+# GNU coreutils' stat --format, or
+# busybox's stat -c, or
+# BSD/macOS stat -f.
# Default to 0 if 'stat' is not available.
stat . 2>/dev/null 1>/dev/null
if test $? != 0
then MTIME=""
-elif test -n "$(stat --version 2>/dev/null | grep coreutils)"
+elif stat --version 2>/dev/null | grep -Fq 'coreutils'
then MTIME="stat --format %Y"
-else MTIME="stat -f %m"
+elif stat 2>&1 | grep -Fq 'busybox'
+then MTIME="stat -c %Y"
+else MTIME="stat -f %m" # BSD stat?
fi
mtime() {
# The check itself
SOURCE_MTIME=$(mtime parsing/parser.mly)
GENERATED_MTIME=$(mtime boot/menhir/parser.ml)
-if test $SOURCE_MTIME -gt $(( $GENERATED_MTIME + 10 ))
+if test -z "$SOURCE_MTIME" -o -z "$GENERATED_MTIME"
+then
+ echo
+ tput setaf 3; tput bold; printf "Warning: "; tput sgr0
+ echo "Failed to check if boot/menhir/parser.ml is up-to-date."
+elif test "$SOURCE_MTIME" -gt $(( GENERATED_MTIME + 10 ))
then
echo
tput setaf 3; tput bold; printf "Warning: "; tput sgr0
ocaml-ppc-64)
CCOMP="CC='gcc -m64'"
OCAML_CONFIGURE_OPTIONS=;;
+ ocaml-openbsd-64)
+ OCAML_CONFIGURE_OPTIONS='--with-bfd'
esac
#########################################################################
jobs=''
case "${OCAML_ARCH}" in
- bsd) make=gmake ;;
- macos) ;;
+ bsd)
+ make=gmake
+ ;;
+ macos)
+ confoptions="$confoptions --with-bfd "
+ ;;
linux)
check_make_alldepend=true
;;
else
Asmgen.compile_implementation_flambda
~required_globals ~backend ~toplevel:need_symbol fn ~ppf_dump:ppf
- (Flambda_middle_end.middle_end ~ppf_dump:ppf ~prefixname:"" ~backend ~size
+ (Flambda_middle_end.middle_end ~ppf_dump:ppf ~prefixname:fn ~backend ~size
~module_ident ~module_initializer:slam ~filename:"toplevel");
Asmlink.call_linker_shared [fn ^ ext_obj] dll;
Sys.remove (fn ^ ext_obj);