File tree 5 files changed +14
-8
lines changed
5 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,7 @@ type dll_handle
19
19
type dll_address
20
20
type dll_mode = For_checking | For_execution
21
21
22
- external dll_open5 : string -> dll_handle = " caml_dynlink_open_lib"
23
-
24
- external dll_open4 : dll_mode -> string -> dll_handle = " caml_dynlink_open_lib"
25
-
26
- let dll_open mode path =
27
- if Config. runtime5 then dll_open5 path else dll_open4 mode path
28
-
22
+ external dll_open : dll_mode -> string -> dll_handle = " caml_dynlink_open_lib"
29
23
external dll_close : dll_handle -> unit = " caml_dynlink_close_lib"
30
24
external dll_sym : dll_handle -> string -> dll_address
31
25
= " caml_dynlink_lookup_symbol"
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ open Clflags
19
19
module Options = Main_args. Make_bytecomp_options (Main_args.Default. Main )
20
20
21
21
let main argv ppf =
22
+ Symbol. this_is_ocamlc () ;
22
23
let program = " ocamlc" in
23
24
Clflags. add_arguments __LOC__ Options. list ;
24
25
Clflags. add_arguments __LOC__
Original file line number Diff line number Diff line change @@ -235,7 +235,9 @@ void caml_free_shared_libs(void)
235
235
236
236
#define Handle_val (v ) (*((void **) (v)))
237
237
238
- CAMLprim value caml_dynlink_open_lib (value filename )
238
+ /* The mode argument is here for compatibility with runtime4. */
239
+ /* CR ocaml 5 runtime: Remove [mode] when all-runtime5. */
240
+ CAMLprim value caml_dynlink_open_lib (value mode , value filename )
239
241
{
240
242
void * handle ;
241
243
value result ;
Original file line number Diff line number Diff line change 47
47
48
48
let caml_symbol_prefix = " caml"
49
49
50
+ (* CR ocaml 5 runtime: Remove this_is_ocamlc and force_runtime4_symbols once
51
+ fully on runtime5 *)
52
+ let this_is_ocamlc = ref false
50
53
let force_runtime4_symbols = ref false
51
54
52
55
let separator () =
56
+ if ! this_is_ocamlc then
57
+ Misc. fatal_error " Didn't expect utils/symbol.ml to be used in ocamlc" ;
53
58
if Config. runtime5 && not ! force_runtime4_symbols then " ." else " __"
54
59
60
+ let this_is_ocamlc () = this_is_ocamlc := true
55
61
let force_runtime4_symbols () = force_runtime4_symbols := true
56
62
57
63
let linkage_name t = t.linkage_name
Original file line number Diff line number Diff line change @@ -49,3 +49,6 @@ val is_predef_exn : t -> bool
49
49
(* Temporary means by which to force symbol names to use __. Only for use
50
50
for flambda2 flexpect tests. *)
51
51
val force_runtime4_symbols : unit -> unit
52
+
53
+ (* Temporary means to identify that the program running is ocamlc. *)
54
+ val this_is_ocamlc : unit -> unit
You can’t perform that action at this time.
0 commit comments