From d76346df62c88e953ffe61b059a54821a4c026b1 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Thu, 3 Sep 2020 14:51:50 +0200 Subject: [PATCH] New upstream version 4.09.1 --- Changes | 49 +++++++- Makefile | 24 ++-- Makefile.common.in | 8 ++ Makefile.config.in | 5 +- VERSION | 2 +- boot/ocamlc | Bin 2623597 -> 2623649 bytes boot/ocamllex | Bin 322927 -> 322927 bytes configure | 156 ++++++++++++++++++------- configure.ac | 108 ++++++++++++----- ocaml-variants.opam | 4 +- parsing/location.ml | 3 +- runtime/backtrace.c | 3 - runtime/caml/gc_ctrl.h | 2 - runtime/caml/mlvalues.h | 2 +- runtime/custom.c | 20 +++- runtime/gc_ctrl.c | 25 ++-- runtime/gen_primitives.sh | 5 +- runtime/interp.c | 2 + runtime/minor_gc.c | 1 + runtime/startup_aux.c | 24 +++- runtime/startup_nat.c | 1 - tools/Makefile | 11 +- tools/check-parser-uptodate-or-warn.sh | 21 +++- tools/ci/inria/main | 10 +- toplevel/opttoploop.ml | 2 +- 25 files changed, 360 insertions(+), 128 deletions(-) diff --git a/Changes b/Changes index d4b8a994..ff969c88 100644 --- 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 "*") diff --git a/Makefile b/Makefile index 47548c79..67913fc9 100644 --- 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 diff --git a/Makefile.common.in b/Makefile.common.in index acd48010..3e0e59c6 100644 --- a/Makefile.common.in +++ b/Makefile.common.in @@ -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)$@ $< diff --git a/Makefile.config.in b/Makefile.config.in index 3e0bedf7..95db931f 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -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 7128cac1..ea176747 100644 --- 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 diff --git a/boot/ocamlc b/boot/ocamlc index 9cc6a5bb55a75639363991cc556557204e3957d8..0b8561907fdfa3ee29b5b8ef3a19cdd388c2c9a2 100755 GIT binary patch delta 620 zcmZ9{O-mb56b9gX#<@3>I7t(yF-fBx<7g91)mkY;Xn%mv3YG{i?4p)JHc?!;Dzqga z6c>t%vr&v2MWkRqXW`0?h3=wsBlrWl5d7$(h2r>5iIBQ@IQN{FIdkvvLY3AQtMs}; z6|K@#(Lc*yd$Khmgy1*LWVz-yIT7NA2ht>ypVwqRFZ9QZrN2EchQ&pr&F50NM)1YA5uB=mH+tNDyJ0wJa*!F zQ67D)Sv;X|q3m2)DF}c8K?p%Jm=J~t+<+*=pam?r32|tJ1SBB^w;&B|&J*6H@mA3(s29`a^7IrR6`gTj iDLUc*=X01t7j(lN_o$d1`J@Gt+-u})+U6%luHzDwrLc(r delta 605 zcmZ9|K}#D^5C`y`WZ%msCeb9uHKsN(8%NeQ{ zJ7}vX;?J3Ak1LA8mYL92fVaXJ69{^chy5Hu3H$vd))l`VK>T^tY__rcic*;mSVmFuwhXsy zY4EBlbA=VOTPF_P%f%HRtFl7B_=hUZe)sbBLf%C0Qr^eDqSiX%m)29zZWVgdF6d4+>608Xx;&wxT?*D)eto zq1SJnsj_h$pke2!X&jai|4tj@L^U3IW{k5wV@$`*<%Na(;Cj_sTUrd?Ha5|KBJ{(6 WqtBF{ybowMY-!~je&B{y&i@BZg{lz% diff --git a/boot/ocamllex b/boot/ocamllex index 261bb7d13fc75adf63f407490ceb2336d80364c8..4fc970db7dbdf38daa6515bf03d85b96ae9e3c14 100755 GIT binary patch delta 25 gcmaEVOZfdQ;f5B*7N!>FEi8`ljE38t;#qY20FUztYybcN delta 25 gcmaEVOZfdQ;f5B*7N!>FEi8`lj0W4C;#qY20FUemYXATM diff --git a/configure b/configure index 85fb6842..d9cc166e 100755 --- 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 . # @@ -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 @@ -15878,11 +15937,12 @@ fi { $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 @@ -15919,12 +15979,13 @@ fi { $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 @@ -15961,12 +16022,13 @@ fi { $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 @@ -16003,12 +16065,13 @@ fi { $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 @@ -16045,21 +16108,34 @@ fi { $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\\" diff --git a/configure.ac b/configure.ac index c2f18537..866b59a3 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ocaml-variants.opam b/ocaml-variants.opam index 30d48eb2..eabd2645 100644 --- a/ocaml-variants.opam +++ b/ocaml-variants.opam @@ -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} diff --git a/parsing/location.ml b/parsing/location.ml index 25cba42c..ab823d36 100644 --- a/parsing/location.ml +++ b/parsing/location.ml @@ -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 () = diff --git a/runtime/backtrace.c b/runtime/backtrace.c index a3c2c08f..ddf7af14 100644 --- a/runtime/backtrace.c +++ b/runtime/backtrace.c @@ -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; diff --git a/runtime/caml/gc_ctrl.h b/runtime/caml/gc_ctrl.h index aeff1ec8..3f1578f9 100644 --- a/runtime/caml/gc_ctrl.h +++ b/runtime/caml/gc_ctrl.h @@ -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 diff --git a/runtime/caml/mlvalues.h b/runtime/caml/mlvalues.h index ec30b20a..c84c2c4c 100644 --- a/runtime/caml/mlvalues.h +++ b/runtime/caml/mlvalues.h @@ -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 */ diff --git a/runtime/custom.c b/runtime/custom.c index 9ec3b222..da755b35 100644 --- a/runtime/custom.c +++ b/runtime/custom.c @@ -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 { diff --git a/runtime/gc_ctrl.c b/runtime/gc_ctrl.c index 4b2efa1a..bb83ba10 100644 --- a/runtime/gc_ctrl.c +++ b/runtime/gc_ctrl.c @@ -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: %" diff --git a/runtime/gen_primitives.sh b/runtime/gen_primitives.sh index e3ca2779..63365a7f 100755 --- a/runtime/gen_primitives.sh +++ b/runtime/gen_primitives.sh @@ -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 diff --git a/runtime/interp.c b/runtime/interp.c index 137e28d6..b4205f64 100644 --- a/runtime/interp.c +++ b/runtime/interp.c @@ -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; diff --git a/runtime/minor_gc.c b/runtime/minor_gc.c index fce3ae06..a2e20fb0 100644 --- a/runtime/minor_gc.c +++ b/runtime/minor_gc.c @@ -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); diff --git a/runtime/startup_aux.c b/runtime/startup_aux.c index a187d91a..97bf4037 100644 --- a/runtime/startup_aux.c +++ b/runtime/startup_aux.c @@ -30,12 +30,30 @@ #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"); } } diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c index b4e6bc47..7eca5fa5 100644 --- a/runtime/startup_nat.c +++ b/runtime/startup_nat.c @@ -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; diff --git a/tools/Makefile b/tools/Makefile index afefc4d8..663961f6 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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 \ diff --git a/tools/check-parser-uptodate-or-warn.sh b/tools/check-parser-uptodate-or-warn.sh index 5502eae5..2f07619a 100755 --- a/tools/check-parser-uptodate-or-warn.sh +++ b/tools/check-parser-uptodate-or-warn.sh @@ -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 @@ -24,15 +27,20 @@ # 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 diff --git a/tools/ci/inria/main b/tools/ci/inria/main index e427196f..e96da630 100755 --- a/tools/ci/inria/main +++ b/tools/ci/inria/main @@ -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 ;; diff --git a/toplevel/opttoploop.ml b/toplevel/opttoploop.ml index 0d1f7392..0174a9ab 100644 --- a/toplevel/opttoploop.ml +++ b/toplevel/opttoploop.ml @@ -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); -- 2.30.2