New upstream version 4.09.1
authorStephane Glondu <steph@glondu.net>
Thu, 3 Sep 2020 12:51:50 +0000 (14:51 +0200)
committerStéphane Glondu <glondu@debian.org>
Thu, 3 Sep 2020 12:51:50 +0000 (14:51 +0200)
25 files changed:
Changes
Makefile
Makefile.common.in
Makefile.config.in
VERSION
boot/ocamlc
boot/ocamllex
configure
configure.ac
ocaml-variants.opam
parsing/location.ml
runtime/backtrace.c
runtime/caml/gc_ctrl.h
runtime/caml/mlvalues.h
runtime/custom.c
runtime/gc_ctrl.c
runtime/gen_primitives.sh
runtime/interp.c
runtime/minor_gc.c
runtime/startup_aux.c
runtime/startup_nat.c
tools/Makefile
tools/check-parser-uptodate-or-warn.sh
tools/ci/inria/main
toplevel/opttoploop.ml

diff --git a/Changes b/Changes
index d4b8a994dd73a3ff8c733155b9dc47aed749427c..ff969c888bc6a761ecc76708fce4fad0f5038037 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,50 @@
-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 "*")
 
index 47548c79d7f79daf6357ef977e55ffb4bab77f01..67913fc96c2d6ad3666777768ec68f2485cc0278 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -326,11 +326,9 @@ endif
 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::
@@ -576,8 +574,10 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
           "$(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) \
@@ -677,7 +677,7 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
            "$(INSTALL_COMPLIBDIR)"
 endif
        $(INSTALL_DATA) \
-           compilerlibs/ocamloptcomp.cma $(OPTSTART) \
+           $(OPTSTART) \
            "$(INSTALL_COMPLIBDIR)"
        if test -n "$(WITH_OCAMLDOC)"; then \
          $(MAKE) -C ocamldoc installopt; \
@@ -722,9 +722,9 @@ installoptopt:
           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)"
@@ -735,8 +735,6 @@ installoptopt:
             toplevel/opttopdirs.cmi \
             "$(INSTALL_LIBDIR)"; \
          $(INSTALL_DATA) \
-            compilerlibs/ocamlopttoplevel.cmxa \
-            compilerlibs/ocamlopttoplevel.$(A) \
             $(OPTTOPLEVELSTART:.cmo=.cmx) $(OPTTOPLEVELSTART:.cmo=.$(O)) \
             "$(INSTALL_COMPLIBDIR)"; \
        fi
@@ -1076,10 +1074,10 @@ parsing/camlinternalMenhirLib.mli: boot/menhir/menhirLib.mli
 
 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
index acd48010ae463c2cba20e8e6856fc87083b37106..3e0e59c6c1bab7507b88361dfc8ef88512a33b5a 100644 (file)
@@ -61,3 +61,11 @@ else
   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)$@ $<
index 3e0bedf7ee7166ec8e9f1187a3cfa2d3944731ef..95db931fee601223165b76692b66a9fa87acd12f 100644 (file)
@@ -164,8 +164,9 @@ PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
 
 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@
diff --git a/VERSION b/VERSION
index 7128cac1fa331c62c02d33302cb17c373b6d2f73..ea176747998f6349727c90359535e477c1a13ce7 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-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
index 9cc6a5bb55a75639363991cc556557204e3957d8..0b8561907fdfa3ee29b5b8ef3a19cdd388c2c9a2 100755 (executable)
Binary files a/boot/ocamlc and b/boot/ocamlc differ
index 261bb7d13fc75adf63f407490ceb2336d80364c8..4fc970db7dbdf38daa6515bf03d85b96ae9e3c14 100755 (executable)
Binary files a/boot/ocamllex and b/boot/ocamllex differ
index 85fb6842dffc1ba52a07895aefa7d49f7f383d17..d9cc166e0e30860a69bb62322814a3f2e2276094 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /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>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # 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'
 
@@ -673,6 +673,8 @@ ac_ct_LD
 LD
 DEFAULT_STRING
 WINDOWS_UNICODE_MODE
+BFD_LIB_DIR
+BFD_INCLUDE_DIR
 LIBUNWIND_LIB_DIR
 LIBUNWIND_INCLUDE_DIR
 DLLIBS
@@ -718,8 +720,9 @@ sharedlib_cflags
 asm_cfi_supported
 AS
 ASPP
-libbfd_link
-libbfd_include
+bfd_ldlibs
+bfd_ldflags
+bfd_cppflags
 x_libraries
 x_includes
 pthread_link
@@ -825,6 +828,7 @@ enable_instrumented_runtime
 enable_vmthreads
 enable_systhreads
 with_libunwind
+with_bfd
 enable_graph_lib
 enable_str_lib
 enable_unix_lib
@@ -863,6 +867,8 @@ PARTIALLD
 DLLIBS
 LIBUNWIND_INCLUDE_DIR
 LIBUNWIND_LIB_DIR
+BFD_INCLUDE_DIR
+BFD_LIB_DIR
 WINDOWS_UNICODE_MODE
 DEFAULT_STRING
 CC
@@ -1412,7 +1418,7 @@ if test "$ac_init_help" = "long"; then
   # 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]...
 
@@ -1478,7 +1484,7 @@ fi
 
 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
 
@@ -1528,6 +1534,8 @@ Optional Packages:
   --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
@@ -1549,6 +1557,9 @@ Some influential environment variables:
               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
@@ -1631,7 +1642,7 @@ fi
 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.
@@ -2294,7 +2305,7 @@ cat >config.log <<_ACEOF
 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 $@
@@ -2643,8 +2654,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-{ $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
 
@@ -2719,7 +2730,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 ## 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
@@ -2810,6 +2821,7 @@ VERSION=4.09.0
 
 
 
+
 
 
 ## Generated files
@@ -3009,6 +3021,19 @@ fi
 
 
 
+
+# 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 \
@@ -12335,7 +12360,7 @@ case $ocaml_cv_cc_vendor in #(
   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" ;; #(
   *) :
@@ -12372,7 +12397,7 @@ case $host in #(
     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.
@@ -12395,7 +12420,7 @@ $as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;};
       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"
@@ -15836,12 +15861,46 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 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
@@ -17124,7 +17200,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # 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
@@ -17191,7 +17267,7 @@ _ACEOF
 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\\"
 
index c2f185373d04e477ac16cf47e19475a4651b5f24..866b59a3245ce307a117646e0fa75c9dda7686a6 100644 (file)
@@ -128,8 +128,9 @@ AC_SUBST([ocamldoc])
 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])
@@ -234,6 +235,18 @@ AC_ARG_VAR([LIBUNWIND_INCLUDE_DIR],
 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: \
@@ -517,7 +530,7 @@ AS_CASE([$host],
   [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.
@@ -537,7 +550,7 @@ AS_CASE([$host],
       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"
@@ -1435,30 +1448,71 @@ AS_IF([test x"$enable_systhreads" = "xno"],
         [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
index 30d48eb24c758930a395eae698f2ebded0a5476e..eabd2645ccd1f013df3a9f5db074f864ade1f2d9 100644 (file)
@@ -1,8 +1,8 @@
 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}
index 25cba42c7d4c241b585aac98ca728bdfb2d8c6d6..ab823d36fa28f958ac8b0107c0d964a0a8bb7571 100644 (file)
@@ -752,7 +752,8 @@ let terminfo_toplevel_printer (lb: lexbuf): report_printer =
   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 () =
index a3c2c08fe100adc44455cdb2fc1a63ff9c920435..ddf7af14706ad8dc1241adeecabd9d2d86be428a 100644 (file)
@@ -27,9 +27,6 @@
 #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;
index aeff1ec8cdc999c8e48af80047565984c67b13f1..3f1578f9926d91657ccffe8cabcf1acf1b091e24 100644 (file)
@@ -33,8 +33,6 @@ extern intnat
      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
index ec30b20a1e179e6cdac9f9569b546b7d721a2cb8..c84c2c4c0f8d7c7e50da68e2b06af0be18bd6c9c 100644 (file)
@@ -345,7 +345,7 @@ CAMLextern int64_t caml_Int64_val(value v);
 
 /* 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 */
index 9ec3b2223459921c90a2a0ff945feed8e85194a4..da755b35f251d458a0036cd39988f4047cfb9d13 100644 (file)
@@ -90,12 +90,20 @@ CAMLexport value caml_alloc_custom_mem(struct custom_operations * ops,
 {
   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 {
index 4b2efa1ac6b5eefa7e4698d1f33ce675513b908a..bb83ba108b23225d6f7c3c99e76ae02651d80cf7 100644 (file)
@@ -392,8 +392,13 @@ static uintnat norm_pmax (uintnat p)
 
 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;
 }
 
@@ -614,14 +619,6 @@ CAMLprim value caml_get_major_credit (value v)
   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,
@@ -630,21 +627,23 @@ 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);
@@ -654,7 +653,7 @@ void caml_init_gc (uintnat minor_size, uintnat major_size,
                    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: %"
index e3ca2779b9743706855b0607a8b9ccc96e992cb0..63365a7fb01588fc93b27f544018e507e09a30dc 100755 (executable)
@@ -17,6 +17,9 @@
 
 # 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 \
@@ -27,4 +30,4 @@
   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
index 137e28d6ec6f770d1553d7cc1578f5f81d7baea6..b4205f645b0cfc120811d8f71d6a819abb6d007b 100644 (file)
@@ -515,6 +515,7 @@ value caml_interprete(code_t prog, asize_t prog_size)
         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]);
@@ -542,6 +543,7 @@ value caml_interprete(code_t prog, asize_t prog_size)
       }
       /* 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;
index fce3ae06a5800cbee0eb502c6811bfe40c925494..a2e20fb0b2f873be6c1b647c821fcb26ff1aee0e 100644 (file)
@@ -138,6 +138,7 @@ void caml_set_minor_heap_size (asize_t bsz)
 
   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);
index a187d91a86593d6401f22de35ca5e26fcdc2222f..97bf403759a4de9fbf6619d1b346a3ad45f7c30d 100644 (file)
 #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);
@@ -44,7 +62,7 @@ void caml_init_atom_table(void)
 #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");
   }
 }
index b4e6bc4743e61c814d93ba6fb8f35c68fe075bdd..7eca5fa5581ea2c6a7cb12dcc7f4ba33bb296163 100644 (file)
@@ -44,7 +44,6 @@
 #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;
 
index afefc4d83c174ffa5964a0a564ea765ded5885fe..663961f6a069a315272616231038c814298cb1be 100644 (file)
@@ -242,6 +242,7 @@ else
        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
@@ -321,9 +322,13 @@ else
 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 \
index 5502eae549e9536ad3d7be5154d77901989de5fd..2f07619a6baeb2a834742a42a0c0b3c5a1e9ef7d 100755 (executable)
@@ -15,6 +15,9 @@
 #*                                                                        *
 #**************************************************************************
 
+# 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() {
@@ -45,7 +53,12 @@ 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
index e427196fe8b0d5561318cd8e904091a16c6eb34e..e96da630c3244abc75a2501901b4ed0f9b0cab37 100755 (executable)
@@ -112,6 +112,8 @@ case $NODE_NAME in
   ocaml-ppc-64)
     CCOMP="CC='gcc -m64'"
     OCAML_CONFIGURE_OPTIONS=;;
+  ocaml-openbsd-64)
+    OCAML_CONFIGURE_OPTIONS='--with-bfd'
 esac
 
 #########################################################################
@@ -131,8 +133,12 @@ dorebase=false
 jobs=''
 
 case "${OCAML_ARCH}" in
-  bsd) make=gmake ;;
-  macos) ;;
+  bsd)
+    make=gmake
+  ;;
+  macos)
+    confoptions="$confoptions --with-bfd "
+  ;;
   linux)
     check_make_alldepend=true
   ;;
index 0d1f73921339f2677d728c18065978a0ff5ba895..0174a9ab544c7106e83508467dfbf3f5f15bf3fb 100644 (file)
@@ -257,7 +257,7 @@ let load_lambda ppf ~module_ident ~required_globals lam size =
   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);