Skip to content

Commit db04e80

Browse files
authored
flambda-backend: Fixes for runtest on runtime5 (#2058)
* Fixing tests/backend/checkmach/ * Fix ocaml/utils/symbol.ml{,i} to force runtime4-style symbols, for tests * Disable flexpect when stack allocation is disabled * Fix runtime dir path in tests/simd/dune * Force runtime4-style symbols in flexpect * Add missing dependency needed by the Makefile * Fix simd stubs inclusion in the runtime .a files * More checkmach test fixing
1 parent 91c199b commit db04e80

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ runtime_COMMON_C_SOURCES = \
720720
runtime_events \
721721
shared_heap \
722722
signals \
723+
simd \
723724
skiplist \
724725
startup_aux \
725726
str \

runtime/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
../.depend
4343
../.depend.menhir
4444
../config.status
45+
../stdlib/StdlibModules
4546
(glob_files caml/*.h)
4647
(glob_files *.h)
4748
caml/domain_state.tbl

utils/symbol.ml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ include Identifiable.Make (struct
4646
end)
4747

4848
let caml_symbol_prefix = "caml"
49-
let separator = if Config.runtime5 then "." else "__"
49+
50+
let force_runtime4_symbols = ref false
51+
52+
let separator () =
53+
if Config.runtime5 && not !force_runtime4_symbols then "." else "__"
54+
55+
let force_runtime4_symbols () = force_runtime4_symbols := true
5056

5157
let linkage_name t = t.linkage_name
5258

@@ -74,7 +80,7 @@ let linkage_name_for_compilation_unit comp_unit =
7480
let pack_names =
7581
CU.Prefix.to_list for_pack_prefix |> List.map CU.Name.to_string
7682
in
77-
String.concat separator (pack_names @ [name])
83+
String.concat (separator ()) (pack_names @ [name])
7884
in
7985
caml_symbol_prefix ^ suffix
8086
|> Linkage_name.of_string
@@ -98,7 +104,7 @@ let for_name compilation_unit name =
98104
linkage_name_for_compilation_unit compilation_unit |> Linkage_name.to_string
99105
in
100106
let linkage_name =
101-
prefix ^ separator ^ name |> Linkage_name.of_string
107+
prefix ^ (separator ()) ^ name |> Linkage_name.of_string
102108
in
103109
{ compilation_unit;
104110
linkage_name;

utils/symbol.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ val linkage_name_for_ocamlobjinfo : t -> string
4545
include Identifiable.S with type t := t
4646

4747
val is_predef_exn : t -> bool
48+
49+
(* Temporary means by which to force symbol names to use __. Only for use
50+
for flambda2 flexpect tests. *)
51+
val force_runtime4_symbols : unit -> unit

0 commit comments

Comments
 (0)