diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 297d72ad45..574cd67f36 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - ubuntu-latest # - windows-latest ocaml-compiler: - - "5.1" + - "5.1.1" # The type of runner that the job will run on runs-on: ${{ matrix.os }} diff --git a/CHANGES.md b/CHANGES.md index aba627c99c..2269fc32a4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,5 @@ -merlin 4.13 -=========== +merlin 4.13.1 +============= Fri Dec 1 15:00:42 CET 2023 + merlin binary @@ -12,6 +12,7 @@ Fri Dec 1 15:00:42 CET 2023 (@goldfirere, #1699) - Fix Merlin reporting errors provoked by the recovery itself (#1709, fixes #1704) + - Add support for OCaml 5.1.1 (#1714) + editor modes - vim: load merlin when Vim is compiled with +python3/dyn (e.g. MacVim) - emacs: highlight only first error line by default (#1693, fixes #1663) diff --git a/merlin-lib.opam b/merlin-lib.opam index 9f1e8f6d42..6fefee90d1 100644 --- a/merlin-lib.opam +++ b/merlin-lib.opam @@ -10,7 +10,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "5.1" & < "5.2"} + "ocaml" {>= "5.1.1" & < "5.2"} "dune" {>= "2.9.0"} "csexp" {>= "1.5.1"} "menhir" {dev & >= "20201216"} diff --git a/src/ocaml/compression/dune b/src/ocaml/compression/dune new file mode 100644 index 0000000000..86c7f02108 --- /dev/null +++ b/src/ocaml/compression/dune @@ -0,0 +1,4 @@ +(library + (name ocaml_compression) + (public_name merlin-lib.ocaml_compression) + (libraries compiler-libs.common)) diff --git a/src/ocaml/compression/ocaml_compression.ml b/src/ocaml/compression/ocaml_compression.ml new file mode 100644 index 0000000000..464aa32bd3 --- /dev/null +++ b/src/ocaml/compression/ocaml_compression.ml @@ -0,0 +1,3 @@ + +(** We rely on [compiler-libs] for compression *) +include Compression diff --git a/src/ocaml/typing/cmi_format.ml b/src/ocaml/typing/cmi_format.ml index 01e27b7cd5..b4934e27e7 100644 --- a/src/ocaml/typing/cmi_format.ml +++ b/src/ocaml/typing/cmi_format.ml @@ -35,7 +35,7 @@ type cmi_infos = { } let input_cmi ic = - let (name, sign) = (input_value ic : header) in + let (name, sign) = (Ocaml_compression.input_value ic : header) in let crcs = (input_value ic : crcs) in let flags = (input_value ic : flags) in { @@ -76,7 +76,7 @@ let read_cmi filename = let output_cmi filename oc cmi = (* beware: the provided signature must have been substituted for saving *) output_string oc Config.cmi_magic_number; - output_value oc ((cmi.cmi_name, cmi.cmi_sign) : header); + Ocaml_compression.output_value oc ((cmi.cmi_name, cmi.cmi_sign) : header); flush oc; let crc = Digest.file filename in let crcs = (cmi.cmi_name, Some crc) :: cmi.cmi_crcs in diff --git a/src/ocaml/typing/cmt_format.ml b/src/ocaml/typing/cmt_format.ml index 49a629879f..6fbc314f0a 100644 --- a/src/ocaml/typing/cmt_format.ml +++ b/src/ocaml/typing/cmt_format.ml @@ -121,11 +121,11 @@ let clear_env binary_annots = exception Error of error -let input_cmt ic = (input_value ic : cmt_infos) +let input_cmt ic = (Ocaml_compression.input_value ic : cmt_infos) let output_cmt oc cmt = output_string oc Config.cmt_magic_number; - output_value oc (cmt : cmt_infos) + Ocaml_compression.output_value oc (cmt : cmt_infos) let read filename = (* Printf.fprintf stderr "Cmt_format.read %s\n%!" filename; *) diff --git a/src/ocaml/typing/dune b/src/ocaml/typing/dune index bebe62fbb2..132d16157e 100644 --- a/src/ocaml/typing/dune +++ b/src/ocaml/typing/dune @@ -7,4 +7,4 @@ -open Merlin_utils (:standard -w -9)) (modules_without_implementation annot outcometree) - (libraries merlin_utils ocaml_parsing ocaml_utils)) + (libraries merlin_utils ocaml_compression ocaml_parsing ocaml_utils)) diff --git a/src/ocaml/typing/typedecl.ml b/src/ocaml/typing/typedecl.ml index e01e80e5f4..c3820f3aec 100644 --- a/src/ocaml/typing/typedecl.ml +++ b/src/ocaml/typing/typedecl.ml @@ -98,7 +98,12 @@ let add_type ~long_path ~check id decl env = | true -> Env.add_type_long_path ~check id decl env | false -> Env.add_type ~check id decl env) -let enter_type rec_flag env sdecl (id, uid) = +(* Add a dummy type declaration to the environment, with the given arity. + The [type_kind] is [Type_abstract], but there is a generic [type_manifest] + for abbreviations, to allow polymorphic expansion, except if + [abstract_abbrevs] is [true]. + This function is only used in [transl_type_decl]. *) +let enter_type ~abstract_abbrevs rec_flag env sdecl (id, uid) = let needed = match rec_flag with | Asttypes.Nonrecursive -> @@ -114,15 +119,17 @@ let enter_type rec_flag env sdecl (id, uid) = in let arity = List.length sdecl.ptype_params in if not needed then env else + let type_manifest = match sdecl.ptype_manifest, abstract_abbrevs with + | None, _ | Some _, true -> None + | Some _, false -> Some(Ctype.newvar ()) + in let decl = { type_params = List.map (fun _ -> Btype.newgenvar ()) sdecl.ptype_params; type_arity = arity; type_kind = Type_abstract; type_private = sdecl.ptype_private; - type_manifest = - begin match sdecl.ptype_manifest with None -> None - | Some _ -> Some(Ctype.newvar ()) end; + type_manifest; type_variance = Variance.unknown_signature ~injective:false ~arity; type_separability = Types.Separability.default_signature ~arity; type_is_newtype = false; @@ -789,7 +796,7 @@ let check_abbrev env sdecl (id, decl) = - if -rectypes is not used, we only allow cycles in the type graph if they go through an object or polymorphic variant type *) -let check_well_founded env loc path to_check visited ty0 = +let check_well_founded ~abs_env env loc path to_check visited ty0 = let rec check parents trace ty = if TypeSet.mem ty parents then begin (*Format.eprintf "@[%a@]@." Printtyp.raw_type_expr ty;*) @@ -805,8 +812,8 @@ let check_well_founded env loc path to_check visited ty0 = | trace -> List.rev trace, false in if rec_abbrev - then Recursive_abbrev (Path.name path, env, reaching_path) - else Cycle_in_def (Path.name path, env, reaching_path) + then Recursive_abbrev (Path.name path, abs_env, reaching_path) + else Cycle_in_def (Path.name path, abs_env, reaching_path) in raise (Error (loc, err)) end; let (fini, parents) = @@ -851,11 +858,11 @@ let check_well_founded env loc path to_check visited ty0 = (* Will be detected by check_regularity *) Btype.backtrack snap -let check_well_founded_manifest env loc path decl = +let check_well_founded_manifest ~abs_env env loc path decl = if decl.type_manifest = None then () else let args = List.map (fun _ -> Ctype.newvar()) decl.type_params in let visited = ref TypeMap.empty in - check_well_founded env loc path (Path.same path) visited + check_well_founded ~abs_env env loc path (Path.same path) visited (Ctype.newconstr path args) (* Given a new type declaration [type t = ...] (potentially mutually-recursive), @@ -873,7 +880,7 @@ let check_well_founded_manifest env loc path decl = (we don't have an example at hand where it is necessary), but we are doing it anyway out of caution. *) -let check_well_founded_decl env loc path decl to_check = +let check_well_founded_decl ~abs_env env loc path decl to_check = let open Btype in (* We iterate on all subexpressions of the declaration to check "in depth" that no ill-founded type exists. *) @@ -892,7 +899,7 @@ let check_well_founded_decl env loc path decl to_check = {type_iterators with it_type_expr = (fun self ty -> if TypeSet.mem ty !checked then () else begin - check_well_founded env loc path to_check visited ty; + check_well_founded ~abs_env env loc path to_check visited ty; checked := TypeSet.add ty !checked; self.it_do_type_expr self ty end)} in @@ -1080,7 +1087,8 @@ let transl_type_decl env rec_flag sdecl_list = Ctype.with_local_level_iter ~post:generalize_decl begin fun () -> (* Enter types. *) let temp_env = - List.fold_left2 (enter_type rec_flag) env sdecl_list ids_list in + List.fold_left2 (enter_type ~abstract_abbrevs:false rec_flag) + env sdecl_list ids_list in (* Translate each declaration. *) let current_slot = ref None in let warn_unused = @@ -1137,14 +1145,23 @@ let transl_type_decl env rec_flag sdecl_list = List.map2 (fun (id, _) sdecl -> (id, sdecl.ptype_loc)) ids_list sdecl_list in + (* Error messages cannot use the new environment, as this might result in + non-termination. Instead we use a completely abstract version of the + temporary environment, giving a reason for why abbreviations cannot be + expanded (#12645, #12649) *) + let abs_env = + List.fold_left2 + (enter_type ~abstract_abbrevs:true rec_flag) + env sdecl_list ids_list in List.iter (fun (id, decl) -> - check_well_founded_manifest new_env (List.assoc id id_loc_list) + check_well_founded_manifest ~abs_env new_env (List.assoc id id_loc_list) (Path.Pident id) decl) decls; let to_check = function Path.Pident id -> List.mem_assoc id id_loc_list | _ -> false in List.iter (fun (id, decl) -> - check_well_founded_decl new_env (List.assoc id id_loc_list) (Path.Pident id) + check_well_founded_decl ~abs_env new_env (List.assoc id id_loc_list) + (Path.Pident id) decl to_check) decls; List.iter @@ -1830,7 +1847,7 @@ let check_recmod_typedecl env loc recmod_ids path decl = (* recmod_ids is the list of recursively-defined module idents. (path, decl) is the type declaration to be checked. *) let to_check path = Path.exists_free recmod_ids path in - check_well_founded_decl env loc path decl to_check; + check_well_founded_decl ~abs_env:env env loc path decl to_check; check_regularity ~orig_env:env env loc path decl to_check; (* additionally check coherece, as one might build an incoherent signature, and use it to build an incoherent module, cf. #7851 *) diff --git a/src/ocaml/typing/types.ml b/src/ocaml/typing/types.ml index f75034b73d..4bba370fbd 100644 --- a/src/ocaml/typing/types.ml +++ b/src/ocaml/typing/types.ml @@ -185,7 +185,7 @@ module Variance = struct let mp = mem May_pos v1 && mem May_pos v2 || mem May_neg v1 && mem May_neg v2 and mn = - mem May_pos v1 && mem May_neg v2 || mem May_pos v1 && mem May_neg v2 + mem May_pos v1 && mem May_neg v2 || mem May_neg v1 && mem May_pos v2 and mw = mem May_weak v1 && v2 <> null || v1 <> null && mem May_weak v2 and inj = mem Inj v1 && mem Inj v2 and pos = mem Pos v1 && mem Pos v2 || mem Neg v1 && mem Neg v2 diff --git a/upstream/ocaml_501/base-rev.txt b/upstream/ocaml_501/base-rev.txt index 9a1aca59eb..eebea0509a 100644 --- a/upstream/ocaml_501/base-rev.txt +++ b/upstream/ocaml_501/base-rev.txt @@ -1 +1 @@ -5717a14d0e3dc2b0e41ab94b82977d5761f70ea2 +35fdd0226e2e05a1a8244ecfec780b563b23b59c diff --git a/upstream/ocaml_501/file_formats/cmi_format.ml b/upstream/ocaml_501/file_formats/cmi_format.ml index aa3d6777a0..3b7a03828f 100644 --- a/upstream/ocaml_501/file_formats/cmi_format.ml +++ b/upstream/ocaml_501/file_formats/cmi_format.ml @@ -42,7 +42,7 @@ type cmi_infos = { } let input_cmi ic = - let (name, sign) = (input_value ic : header) in + let (name, sign) = (Compression.input_value ic : header) in let crcs = (input_value ic : crcs) in let flags = (input_value ic : flags) in { @@ -84,7 +84,7 @@ let read_cmi filename = let output_cmi filename oc cmi = (* beware: the provided signature must have been substituted for saving *) output_string oc Config.cmi_magic_number; - Marshal.(to_channel oc ((cmi.cmi_name, cmi.cmi_sign) : header) [Compression]); + Compression.output_value oc ((cmi.cmi_name, cmi.cmi_sign) : header); flush oc; let crc = Digest.file filename in let crcs = (cmi.cmi_name, Some crc) :: cmi.cmi_crcs in diff --git a/upstream/ocaml_501/file_formats/cmt_format.ml b/upstream/ocaml_501/file_formats/cmt_format.ml index 8fa01e525b..16c3c287da 100644 --- a/upstream/ocaml_501/file_formats/cmt_format.ml +++ b/upstream/ocaml_501/file_formats/cmt_format.ml @@ -105,11 +105,11 @@ let clear_env binary_annots = exception Error of error -let input_cmt ic = (input_value ic : cmt_infos) +let input_cmt ic = (Compression.input_value ic : cmt_infos) let output_cmt oc cmt = output_string oc Config.cmt_magic_number; - Marshal.(to_channel oc (cmt : cmt_infos) [Compression]) + Compression.output_value oc (cmt : cmt_infos) let read filename = (* Printf.fprintf stderr "Cmt_format.read %s\n%!" filename; *) diff --git a/upstream/ocaml_501/typing/typedecl.ml b/upstream/ocaml_501/typing/typedecl.ml index fcfbae876b..7abea49d06 100644 --- a/upstream/ocaml_501/typing/typedecl.ml +++ b/upstream/ocaml_501/typing/typedecl.ml @@ -95,7 +95,12 @@ let add_type ~check id decl env = Builtin_attributes.warning_scope ~ppwarning:false decl.type_attributes (fun () -> Env.add_type ~check id decl env) -let enter_type rec_flag env sdecl (id, uid) = +(* Add a dummy type declaration to the environment, with the given arity. + The [type_kind] is [Type_abstract], but there is a generic [type_manifest] + for abbreviations, to allow polymorphic expansion, except if + [abstract_abbrevs] is [true]. + This function is only used in [transl_type_decl]. *) +let enter_type ~abstract_abbrevs rec_flag env sdecl (id, uid) = let needed = match rec_flag with | Asttypes.Nonrecursive -> @@ -111,15 +116,17 @@ let enter_type rec_flag env sdecl (id, uid) = in let arity = List.length sdecl.ptype_params in if not needed then env else + let type_manifest = match sdecl.ptype_manifest, abstract_abbrevs with + | None, _ | Some _, true -> None + | Some _, false -> Some(Ctype.newvar ()) + in let decl = { type_params = List.map (fun _ -> Btype.newgenvar ()) sdecl.ptype_params; type_arity = arity; type_kind = Type_abstract; type_private = sdecl.ptype_private; - type_manifest = - begin match sdecl.ptype_manifest with None -> None - | Some _ -> Some(Ctype.newvar ()) end; + type_manifest; type_variance = Variance.unknown_signature ~injective:false ~arity; type_separability = Types.Separability.default_signature ~arity; type_is_newtype = false; @@ -782,7 +789,7 @@ let check_abbrev env sdecl (id, decl) = - if -rectypes is not used, we only allow cycles in the type graph if they go through an object or polymorphic variant type *) -let check_well_founded env loc path to_check visited ty0 = +let check_well_founded ~abs_env env loc path to_check visited ty0 = let rec check parents trace ty = if TypeSet.mem ty parents then begin (*Format.eprintf "@[%a@]@." Printtyp.raw_type_expr ty;*) @@ -798,8 +805,8 @@ let check_well_founded env loc path to_check visited ty0 = | trace -> List.rev trace, false in if rec_abbrev - then Recursive_abbrev (Path.name path, env, reaching_path) - else Cycle_in_def (Path.name path, env, reaching_path) + then Recursive_abbrev (Path.name path, abs_env, reaching_path) + else Cycle_in_def (Path.name path, abs_env, reaching_path) in raise (Error (loc, err)) end; let (fini, parents) = @@ -844,11 +851,11 @@ let check_well_founded env loc path to_check visited ty0 = (* Will be detected by check_regularity *) Btype.backtrack snap -let check_well_founded_manifest env loc path decl = +let check_well_founded_manifest ~abs_env env loc path decl = if decl.type_manifest = None then () else let args = List.map (fun _ -> Ctype.newvar()) decl.type_params in let visited = ref TypeMap.empty in - check_well_founded env loc path (Path.same path) visited + check_well_founded ~abs_env env loc path (Path.same path) visited (Ctype.newconstr path args) (* Given a new type declaration [type t = ...] (potentially mutually-recursive), @@ -866,7 +873,7 @@ let check_well_founded_manifest env loc path decl = (we don't have an example at hand where it is necessary), but we are doing it anyway out of caution. *) -let check_well_founded_decl env loc path decl to_check = +let check_well_founded_decl ~abs_env env loc path decl to_check = let open Btype in (* We iterate on all subexpressions of the declaration to check "in depth" that no ill-founded type exists. *) @@ -885,7 +892,7 @@ let check_well_founded_decl env loc path decl to_check = {type_iterators with it_type_expr = (fun self ty -> if TypeSet.mem ty !checked then () else begin - check_well_founded env loc path to_check visited ty; + check_well_founded ~abs_env env loc path to_check visited ty; checked := TypeSet.add ty !checked; self.it_do_type_expr self ty end)} in @@ -1073,7 +1080,8 @@ let transl_type_decl env rec_flag sdecl_list = Ctype.with_local_level_iter ~post:generalize_decl begin fun () -> (* Enter types. *) let temp_env = - List.fold_left2 (enter_type rec_flag) env sdecl_list ids_list in + List.fold_left2 (enter_type ~abstract_abbrevs:false rec_flag) + env sdecl_list ids_list in (* Translate each declaration. *) let current_slot = ref None in let warn_unused = @@ -1130,14 +1138,23 @@ let transl_type_decl env rec_flag sdecl_list = List.map2 (fun (id, _) sdecl -> (id, sdecl.ptype_loc)) ids_list sdecl_list in + (* Error messages cannot use the new environment, as this might result in + non-termination. Instead we use a completely abstract version of the + temporary environment, giving a reason for why abbreviations cannot be + expanded (#12645, #12649) *) + let abs_env = + List.fold_left2 + (enter_type ~abstract_abbrevs:true rec_flag) + env sdecl_list ids_list in List.iter (fun (id, decl) -> - check_well_founded_manifest new_env (List.assoc id id_loc_list) + check_well_founded_manifest ~abs_env new_env (List.assoc id id_loc_list) (Path.Pident id) decl) decls; let to_check = function Path.Pident id -> List.mem_assoc id id_loc_list | _ -> false in List.iter (fun (id, decl) -> - check_well_founded_decl new_env (List.assoc id id_loc_list) (Path.Pident id) + check_well_founded_decl ~abs_env new_env (List.assoc id id_loc_list) + (Path.Pident id) decl to_check) decls; List.iter @@ -1818,7 +1835,7 @@ let check_recmod_typedecl env loc recmod_ids path decl = (* recmod_ids is the list of recursively-defined module idents. (path, decl) is the type declaration to be checked. *) let to_check path = Path.exists_free recmod_ids path in - check_well_founded_decl env loc path decl to_check; + check_well_founded_decl ~abs_env:env env loc path decl to_check; check_regularity ~orig_env:env env loc path decl to_check; (* additionally check coherece, as one might build an incoherent signature, and use it to build an incoherent module, cf. #7851 *) diff --git a/upstream/ocaml_501/typing/types.ml b/upstream/ocaml_501/typing/types.ml index 45a4f896d6..c1dbdb6895 100644 --- a/upstream/ocaml_501/typing/types.ml +++ b/upstream/ocaml_501/typing/types.ml @@ -186,7 +186,7 @@ module Variance = struct let mp = mem May_pos v1 && mem May_pos v2 || mem May_neg v1 && mem May_neg v2 and mn = - mem May_pos v1 && mem May_neg v2 || mem May_pos v1 && mem May_neg v2 + mem May_pos v1 && mem May_neg v2 || mem May_neg v1 && mem May_pos v2 and mw = mem May_weak v1 && v2 <> null || v1 <> null && mem May_weak v2 and inj = mem Inj v1 && mem Inj v2 and pos = mem Pos v1 && mem Pos v2 || mem Neg v1 && mem Neg v2 diff --git a/upstream/ocaml_501/utils/config.common.ml b/upstream/ocaml_501/utils/config.common.ml index 9fa25b1dfa..d4850ffd50 100644 --- a/upstream/ocaml_501/utils/config.common.ml +++ b/upstream/ocaml_501/utils/config.common.ml @@ -122,7 +122,6 @@ let configuration_variables () = p_bool "supports_shared_libraries" supports_shared_libraries; p_bool "native_dynlink" native_dynlink; p_bool "naked_pointers" naked_pointers; - p_bool "compression_supported" (Marshal.compression_supported()); p "exec_magic_number" exec_magic_number; p "cmi_magic_number" cmi_magic_number; diff --git a/upstream/ocaml_501/utils/config.ml b/upstream/ocaml_501/utils/config.ml index cb65204acc..470944cf6a 100644 --- a/upstream/ocaml_501/utils/config.ml +++ b/upstream/ocaml_501/utils/config.ml @@ -27,13 +27,13 @@ let c_compiler = {|gcc|} let c_output_obj = {|-o |} let c_has_debug_prefix_map = true let as_has_debug_prefix_map = false -let ocamlc_cflags = {|-O2 -fno-strict-aliasing -fwrapv -pthread |} +let ocamlc_cflags = {| -O2 -fno-strict-aliasing -fwrapv -pthread -pthread|} let ocamlc_cppflags = {| -D_FILE_OFFSET_BITS=64 |} (* #7678: ocamlopt uses these only to compile .c files, and the behaviour for the two drivers should be identical. *) -let ocamlopt_cflags = {|-O2 -fno-strict-aliasing -fwrapv -pthread |} +let ocamlopt_cflags = {| -O2 -fno-strict-aliasing -fwrapv -pthread -pthread|} let ocamlopt_cppflags = {| -D_FILE_OFFSET_BITS=64 |} -let bytecomp_c_libraries = {| -L/opt/homebrew/Cellar/zstd/1.5.2/lib -lzstd -lm -lpthread|} +let bytecomp_c_libraries = {| -L/opt/homebrew/opt/zstd/lib -lzstd -lpthread|} (* bytecomp_c_compiler and native_c_compiler have been supported for a long time and are retained for backwards compatibility. For programs that don't need compatibility with older OCaml releases @@ -44,36 +44,17 @@ let bytecomp_c_compiler = c_compiler ^ " " ^ ocamlc_cflags ^ " " ^ ocamlc_cppflags let native_c_compiler = c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags -let native_c_libraries = {| -L/opt/homebrew/Cellar/zstd/1.5.2/lib -lzstd -lm -lpthread|} +let native_c_libraries = {| -L/opt/homebrew/opt/zstd/lib -lzstd -lpthread|} +let native_ldflags = {||} let native_pack_linker = {|ld -r -o |} let default_rpath = {||} let mksharedlibrpath = {||} let ar = {|ar|} let supports_shared_libraries = true let native_dynlink = true -let mkdll, mkexe, mkmaindll = - if Sys.win32 || Sys.cygwin && supports_shared_libraries then - let flexlink = - let flexlink = - Option.value ~default:"flexlink" (Sys.getenv_opt "OCAML_FLEXLINK") - in - let f i = - let c = flexlink.[i] in - if c = '/' && Sys.win32 then '\\' else c - in - String.init (String.length flexlink) f - in - let flexdll_chain = {||} in - let flexlink_flags = {||} in - let flags = " -chain " ^ flexdll_chain ^ " " ^ flexlink_flags in - flexlink ^ flags ^ {| |}, - flexlink ^ " -exe" ^ flags - ^ {| |} ^ {| |}, - flexlink ^ " -maindll" ^ flags ^ {| |} - else - {|gcc -shared -undefined dynamic_lookup -Wl,-w |}, - {|gcc -O2 -fno-strict-aliasing -fwrapv -pthread |}, - {|gcc -shared -undefined dynamic_lookup -Wl,-w|} +let mkdll = {|gcc -shared -undefined dynamic_lookup -Wl,-w |} +let mkexe = {|gcc -O2 -fno-strict-aliasing -fwrapv -pthread -pthread |} +let mkmaindll = {|gcc -shared -undefined dynamic_lookup -Wl,-w |} let flambda = false let with_flambda_invariants = false @@ -102,15 +83,18 @@ let ext_asm = "." ^ {|s|} let ext_lib = "." ^ {|a|} let ext_dll = "." ^ {|so|} -let host = {|aarch64-apple-darwin22.3.0|} -let target = {|aarch64-apple-darwin22.3.0|} +let host = {|aarch64-apple-darwin23.0.0|} +let target = {|aarch64-apple-darwin23.0.0|} let systhread_supported = true let flexdll_dirs = [] let ar_supports_response_files = true -#2 "utils/config.common.ml" + +let tsan = false +(* utils/config.common.ml. Generated from config.common.ml.in by configure. *) +#3 "utils/config.common.ml.in" (**************************************************************************) (* *) (* OCaml *) @@ -140,26 +124,18 @@ let standard_library = with Not_found -> standard_library_default -let exec_magic_number = "Caml1999X033" +let exec_magic_number = {magic|Caml1999X033|magic} (* exec_magic_number is duplicated in runtime/caml/exec.h *) -and cmi_magic_number = "Caml1999I033" -and cmo_magic_number = "Caml1999O033" -and cma_magic_number = "Caml1999A033" -and cmx_magic_number = - if flambda then - "Caml1999y033" - else - "Caml1999Y033" -and cmxa_magic_number = - if flambda then - "Caml1999z033" - else - "Caml1999Z033" -and ast_impl_magic_number = "Caml1999M033" -and ast_intf_magic_number = "Caml1999N033" -and cmxs_magic_number = "Caml1999D033" -and cmt_magic_number = "Caml1999T033" -and linear_magic_number = "Caml1999L033" +and cmi_magic_number = {magic|Caml1999I033|magic} +and cmo_magic_number = {magic|Caml1999O033|magic} +and cma_magic_number = {magic|Caml1999A033|magic} +and cmx_magic_number = {magic|Caml1999Y033|magic} +and cmxa_magic_number = {magic|Caml1999Z033|magic} +and ast_impl_magic_number = {magic|Caml1999M033|magic} +and ast_intf_magic_number = {magic|Caml1999N033|magic} +and cmxs_magic_number = {magic|Caml1999D033|magic} +and cmt_magic_number = {magic|Caml1999T033|magic} +and linear_magic_number = {magic|Caml1999L033|magic} let safe_string = true let default_safe_string = true @@ -204,6 +180,7 @@ let configuration_variables () = p "native_c_compiler" native_c_compiler; p "bytecomp_c_libraries" bytecomp_c_libraries; p "native_c_libraries" native_c_libraries; + p "native_ldflags" native_ldflags; p "native_pack_linker" native_pack_linker; p_bool "native_compiler" native_compiler; p "architecture" architecture; @@ -230,6 +207,7 @@ let configuration_variables () = p_bool "flat_float_array" flat_float_array; p_bool "function_sections" function_sections; p_bool "afl_instrument" afl_instrument; + p_bool "tsan" tsan; p_bool "windows_unicode" windows_unicode; p_bool "supports_shared_libraries" supports_shared_libraries; p_bool "native_dynlink" native_dynlink;