Skip to content

Commit

Permalink
flambda-backend: Fixes for runtest on runtime5 (#2058)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mshinwell authored Nov 21, 2023
1 parent 91c199b commit db04e80
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ runtime_COMMON_C_SOURCES = \
runtime_events \
shared_heap \
signals \
simd \
skiplist \
startup_aux \
str \
Expand Down
1 change: 1 addition & 0 deletions runtime/dune
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
../.depend
../.depend.menhir
../config.status
../stdlib/StdlibModules
(glob_files caml/*.h)
(glob_files *.h)
caml/domain_state.tbl
Expand Down
12 changes: 9 additions & 3 deletions utils/symbol.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ include Identifiable.Make (struct
end)

let caml_symbol_prefix = "caml"
let separator = if Config.runtime5 then "." else "__"

let force_runtime4_symbols = ref false

let separator () =
if Config.runtime5 && not !force_runtime4_symbols then "." else "__"

let force_runtime4_symbols () = force_runtime4_symbols := true

let linkage_name t = t.linkage_name

Expand Down Expand Up @@ -74,7 +80,7 @@ let linkage_name_for_compilation_unit comp_unit =
let pack_names =
CU.Prefix.to_list for_pack_prefix |> List.map CU.Name.to_string
in
String.concat separator (pack_names @ [name])
String.concat (separator ()) (pack_names @ [name])
in
caml_symbol_prefix ^ suffix
|> Linkage_name.of_string
Expand All @@ -98,7 +104,7 @@ let for_name compilation_unit name =
linkage_name_for_compilation_unit compilation_unit |> Linkage_name.to_string
in
let linkage_name =
prefix ^ separator ^ name |> Linkage_name.of_string
prefix ^ (separator ()) ^ name |> Linkage_name.of_string
in
{ compilation_unit;
linkage_name;
Expand Down
4 changes: 4 additions & 0 deletions utils/symbol.mli
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ val linkage_name_for_ocamlobjinfo : t -> string
include Identifiable.S with type t := t

val is_predef_exn : t -> bool

(* Temporary means by which to force symbol names to use __. Only for use
for flambda2 flexpect tests. *)
val force_runtime4_symbols : unit -> unit

0 comments on commit db04e80

Please sign in to comment.