@grain/binaryen.ml 0.20.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. binaryen-archive/CHANGELOG.md +64 -0
  2. binaryen-archive/binaryen.opam +3 -3
  3. binaryen-archive/esy.lock/index.json +491 -426
  4. binaryen-archive/esy.lock/opam/{base.v0.15.1 → base.v0.16.1}/opam +7 -4
  5. binaryen-archive/esy.lock/opam/{chrome-trace.3.6.1 → chrome-trace.3.9.1}/opam +4 -4
  6. binaryen-archive/esy.lock/opam/{cmdliner.1.1.1 → cmdliner.1.2.0}/opam +2 -2
  7. binaryen-archive/esy.lock/opam/{csexp.1.5.1 → csexp.1.5.2}/opam +7 -9
  8. binaryen-archive/esy.lock/opam/{dune-build-info.3.6.1 → dune-build-info.3.9.1}/opam +4 -4
  9. binaryen-archive/esy.lock/opam/{dune-configurator.3.6.1 → dune-configurator.3.9.1}/opam +4 -4
  10. binaryen-archive/esy.lock/opam/{dune-rpc.3.6.1 → dune-rpc.3.9.1}/opam +4 -4
  11. binaryen-archive/esy.lock/opam/{dune.3.6.1 → dune.3.9.1}/opam +5 -5
  12. binaryen-archive/esy.lock/opam/{dyn.3.6.1 → dyn.3.9.1}/opam +4 -4
  13. binaryen-archive/esy.lock/opam/fiber.3.7.0/opam +39 -0
  14. binaryen-archive/esy.lock/opam/{fix.20220121 → fix.20230505}/opam +3 -3
  15. binaryen-archive/esy.lock/opam/gen.1.1/opam +31 -0
  16. binaryen-archive/esy.lock/opam/{js_of_ocaml-compiler.4.1.0 → js_of_ocaml-compiler.5.4.0}/opam +10 -10
  17. binaryen-archive/esy.lock/opam/{menhir.20220210 → menhir.20230608}/opam +4 -4
  18. binaryen-archive/esy.lock/opam/{menhirLib.20220210 → menhirLib.20230608}/opam +4 -4
  19. binaryen-archive/esy.lock/opam/{menhirSdk.20220210 → menhirSdk.20230608}/opam +4 -4
  20. binaryen-archive/esy.lock/opam/{ocamlbuild.0.14.2 → ocamlbuild.0.14.2+win}/opam +13 -14
  21. binaryen-archive/esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch +12 -0
  22. binaryen-archive/esy.lock/opam/{ocamlfind.1.9.5 → ocamlfind.1.9.6}/opam +8 -7
  23. binaryen-archive/esy.lock/opam/{ocamlformat-rpc-lib.0.24.1 → ocamlformat-rpc-lib.0.25.1}/opam +4 -4
  24. binaryen-archive/esy.lock/opam/ocamlformat.0.24.1/opam +1 -1
  25. binaryen-archive/esy.lock/opam/{ordering.3.6.1 → ordering.3.9.1}/opam +4 -4
  26. binaryen-archive/esy.lock/opam/{ppx_yojson_conv_lib.v0.15.0 → ppx_yojson_conv_lib.v0.16.0}/opam +3 -3
  27. binaryen-archive/esy.lock/opam/{ppxlib.0.28.0 → ppxlib.0.29.1}/opam +5 -5
  28. binaryen-archive/esy.lock/opam/sedlex.3.2/opam +48 -0
  29. binaryen-archive/esy.lock/opam/{sexplib0.v0.15.1 → sexplib0.v0.16.0}/opam +3 -3
  30. binaryen-archive/esy.lock/opam/{stdio.v0.15.0 → stdio.v0.16.0}/opam +4 -4
  31. binaryen-archive/esy.lock/opam/{stdune.3.6.1 → stdune.3.9.1}/opam +4 -4
  32. binaryen-archive/esy.lock/opam/{topkg.1.0.6 → topkg.1.0.7}/opam +2 -2
  33. binaryen-archive/esy.lock/opam/{xdg.3.6.1 → xdg.3.9.1}/opam +4 -4
  34. binaryen-archive/esy.lock/opam/{yojson.2.0.2 → yojson.2.1.0}/opam +33 -23
  35. binaryen-archive/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2+win_opam_override/files/ocamlbuild-0.14.2.patch +0 -0
  36. binaryen-archive/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch +11 -0
  37. binaryen-archive/package.json +3 -3
  38. binaryen-archive/src/array_type.c +29 -0
  39. binaryen-archive/src/array_type.js +17 -0
  40. binaryen-archive/src/array_type.ml +8 -0
  41. binaryen-archive/src/array_type.mli +3 -0
  42. binaryen-archive/src/dune +38 -32
  43. binaryen-archive/src/{binaryen_stubs_exports.c → export.c} +0 -8
  44. binaryen-archive/src/{binaryen_stubs_expressions.c → expression.c} +24 -15
  45. binaryen-archive/src/{binaryen_stubs_expressions.js → expression.js} +20 -6
  46. binaryen-archive/src/expression.ml +14 -5
  47. binaryen-archive/src/expression.mli +10 -2
  48. binaryen-archive/src/{binaryen_stubs_functions.c → function.c} +0 -24
  49. binaryen-archive/src/{binaryen_stubs_globals.c → global.c} +0 -25
  50. binaryen-archive/src/heap_type.c +171 -0
  51. binaryen-archive/src/heap_type.js +131 -0
  52. binaryen-archive/src/heap_type.ml +12 -1
  53. binaryen-archive/src/heap_type.mli +12 -1
  54. binaryen-archive/src/{binaryen_stubs_literals.c → literal.c} +0 -9
  55. binaryen-archive/src/{binaryen_stubs_memory.c → memory.c} +15 -5
  56. binaryen-archive/src/{binaryen_stubs_memory.js → memory.js} +11 -1
  57. binaryen-archive/src/memory.ml +6 -3
  58. binaryen-archive/src/memory.mli +10 -1
  59. binaryen-archive/src/{binaryen_stubs_modules.c → module.c} +0 -9
  60. binaryen-archive/src/module.ml +4 -5
  61. binaryen-archive/src/module.mli +1 -1
  62. binaryen-archive/src/{binaryen_stubs_features.c → module_feature.c} +6 -6
  63. binaryen-archive/src/{binaryen_stubs_features.js → module_feature.js} +6 -6
  64. binaryen-archive/src/ocaml_helpers.c +87 -0
  65. binaryen-archive/src/ocaml_helpers.h +33 -0
  66. binaryen-archive/src/{binaryen_stubs_ops.c → op.c} +597 -333
  67. binaryen-archive/src/op.js +2129 -0
  68. binaryen-archive/src/op.ml +499 -352
  69. binaryen-archive/src/op.mli +46 -7
  70. binaryen-archive/src/passes.ml +46 -0
  71. binaryen-archive/src/passes.mli +45 -0
  72. binaryen-archive/src/signature_type.c +23 -0
  73. binaryen-archive/src/signature_type.js +11 -0
  74. binaryen-archive/src/signature_type.ml +5 -0
  75. binaryen-archive/src/signature_type.mli +2 -0
  76. binaryen-archive/src/struct_type.c +39 -0
  77. binaryen-archive/src/struct_type.js +23 -0
  78. binaryen-archive/src/struct_type.ml +11 -0
  79. binaryen-archive/src/struct_type.mli +4 -0
  80. binaryen-archive/src/{binaryen_stubs_tables.c → table.c} +0 -25
  81. binaryen-archive/src/{binaryen_stubs_types.c → type.c} +30 -12
  82. binaryen-archive/src/{binaryen_stubs_types.js → type.js} +31 -3
  83. binaryen-archive/src/type.ml +18 -2
  84. binaryen-archive/src/type.mli +5 -1
  85. binaryen-archive/src/{binaryen_stubs_type_system.c → type_system.c} +0 -6
  86. binaryen-archive/src/{binaryen_stubs_type_system.js → type_system.js} +0 -6
  87. binaryen-archive/src/type_system.ml +0 -1
  88. binaryen-archive/src/type_system.mli +0 -1
  89. binaryen-archive/test/test.expected +13 -13
  90. binaryen-archive/test/test.ml +11 -3
  91. binaryen-archive/esy.lock/opam/fiber.3.6.1/opam +0 -41
  92. binaryen-archive/esy.lock/opam/ocamlfind.1.9.5/files/0001-Fix-bug-when-installing-with-a-system-compiler.patch +0 -26
  93. binaryen-archive/esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.5_opam_override/files/findlib.patch +0 -485
  94. binaryen-archive/src/binaryen_stubs_heap_types.c +0 -95
  95. binaryen-archive/src/binaryen_stubs_heap_types.js +0 -65
  96. binaryen-archive/src/binaryen_stubs_ops.js +0 -1895
  97. /binaryen-archive/esy.lock/overrides/{opam__s__ocamlbuild_opam__c__0.14.2_opam_override → opam__s__ocamlbuild_opam__c__0.14.2+win_opam_override}/files/winpatch.patch +0 -0
  98. /binaryen-archive/esy.lock/overrides/{opam__s__ocamlbuild_opam__c__0.14.2_opam_override → opam__s__ocamlbuild_opam__c__0.14.2+win_opam_override}/package.json +0 -0
  99. /binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.5_opam_override → opam__s__ocamlfind_opam__c__1.9.6_opam_override}/package.json +0 -0
  100. /binaryen-archive/src/{binaryen_stubs_exports.js → export.js} +0 -0
  101. /binaryen-archive/src/{binaryen_stubs_functions.js → function.js} +0 -0
  102. /binaryen-archive/src/{binaryen_stubs_globals.js → global.js} +0 -0
  103. /binaryen-archive/src/{binaryen_stubs_imports.c → import.c} +0 -0
  104. /binaryen-archive/src/{binaryen_stubs_imports.js → import.js} +0 -0
  105. /binaryen-archive/src/{binaryen_stubs_literals.js → literal.js} +0 -0
  106. /binaryen-archive/src/{binaryen_stubs_modules.js → module.js} +0 -0
  107. /binaryen-archive/src/{binaryen_stubs_packed_types.c → packed_type.c} +0 -0
  108. /binaryen-archive/src/{binaryen_stubs_packed_types.js → packed_type.js} +0 -0
  109. /binaryen-archive/src/{binaryen_stubs_settings.c → settings.c} +0 -0
  110. /binaryen-archive/src/{binaryen_stubs_settings.js → settings.js} +0 -0
  111. /binaryen-archive/src/{binaryen_stubs_tables.js → table.js} +0 -0
@@ -1,485 +0,0 @@
1
- --- ./Makefile
2
- +++ ./Makefile
3
- @@ -57,16 +57,16 @@
4
- cat findlib.conf.in | \
5
- $(SH) tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf
6
- if ./tools/cmd_from_same_dir ocamlc; then \
7
- - echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \
8
- + echo 'ocamlc="ocamlc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \
9
- fi
10
- if ./tools/cmd_from_same_dir ocamlopt; then \
11
- - echo 'ocamlopt="ocamlopt.opt"' >>findlib.conf; \
12
- + echo 'ocamlopt="ocamlopt.opt$(EXEC_SUFFIX)"' >>findlib.conf; \
13
- fi
14
- if ./tools/cmd_from_same_dir ocamldep; then \
15
- - echo 'ocamldep="ocamldep.opt"' >>findlib.conf; \
16
- + echo 'ocamldep="ocamldep.opt$(EXEC_SUFFIX)"' >>findlib.conf; \
17
- fi
18
- if ./tools/cmd_from_same_dir ocamldoc; then \
19
- - echo 'ocamldoc="ocamldoc.opt"' >>findlib.conf; \
20
- + echo 'ocamldoc="ocamldoc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \
21
- fi
22
-
23
- .PHONY: install-doc
24
- --- ./src/findlib/findlib_config.mlp
25
- +++ ./src/findlib/findlib_config.mlp
26
- @@ -24,3 +24,5 @@
27
- | "MacOS" -> "" (* don't know *)
28
- | _ -> failwith "Unknown Sys.os_type"
29
- ;;
30
- +
31
- +let exec_suffix = "@EXEC_SUFFIX@";;
32
- --- ./src/findlib/findlib.ml
33
- +++ ./src/findlib/findlib.ml
34
- @@ -28,15 +28,20 @@
35
- let conf_ldconf = ref "";;
36
- let conf_ignore_dups_in = ref ([] : string list);;
37
-
38
- -let ocamlc_default = "ocamlc";;
39
- -let ocamlopt_default = "ocamlopt";;
40
- -let ocamlcp_default = "ocamlcp";;
41
- -let ocamloptp_default = "ocamloptp";;
42
- -let ocamlmklib_default = "ocamlmklib";;
43
- -let ocamlmktop_default = "ocamlmktop";;
44
- -let ocamldep_default = "ocamldep";;
45
- -let ocamlbrowser_default = "ocamlbrowser";;
46
- -let ocamldoc_default = "ocamldoc";;
47
- +let add_exec str =
48
- + match Findlib_config.exec_suffix with
49
- + | "" -> str
50
- + | a -> str ^ a ;;
51
- +let ocamlc_default = add_exec "ocamlc";;
52
- +let ocamlopt_default = add_exec "ocamlopt";;
53
- +let ocamlcp_default = add_exec "ocamlcp";;
54
- +let ocamloptp_default = add_exec "ocamloptp";;
55
- +let ocamlmklib_default = add_exec "ocamlmklib";;
56
- +let ocamlmktop_default = add_exec "ocamlmktop";;
57
- +let ocamldep_default = add_exec "ocamldep";;
58
- +let ocamlbrowser_default = add_exec "ocamlbrowser";;
59
- +let ocamldoc_default = add_exec "ocamldoc";;
60
- +
61
-
62
-
63
- let init_manually
64
- --- ./src/findlib/fl_package_base.ml
65
- +++ ./src/findlib/fl_package_base.ml
66
- @@ -133,7 +133,15 @@
67
- List.find (fun def -> def.def_var = "exists_if") p.package_defs in
68
- let files = Fl_split.in_words def.def_value in
69
- List.exists
70
- - (fun file -> Sys.file_exists (Filename.concat d' file))
71
- + (fun file ->
72
- + let fln = Filename.concat d' file in
73
- + let e = Sys.file_exists fln in
74
- + (* necessary for ppx executables *)
75
- + if e || Sys.os_type <> "Win32" || Filename.check_suffix fln ".exe" then
76
- + e
77
- + else
78
- + Sys.file_exists (fln ^ ".exe")
79
- + )
80
- files
81
- with Not_found -> true in
82
-
83
- --- ./src/findlib/fl_split.ml
84
- +++ ./src/findlib/fl_split.ml
85
- @@ -126,10 +126,17 @@
86
- | '/' | '\\' -> true
87
- | _ -> false in
88
- let norm_dir_win() =
89
- - if l >= 1 && s.[0] = '/' then
90
- - Buffer.add_char b '\\' else Buffer.add_char b s.[0];
91
- - if l >= 2 && s.[1] = '/' then
92
- - Buffer.add_char b '\\' else Buffer.add_char b s.[1];
93
- + if l >= 1 then (
94
- + if s.[0] = '/' then
95
- + Buffer.add_char b '\\'
96
- + else
97
- + Buffer.add_char b s.[0] ;
98
- + if l >= 2 then
99
- + if s.[1] = '/' then
100
- + Buffer.add_char b '\\'
101
- + else
102
- + Buffer.add_char b s.[1];
103
- + );
104
- for k = 2 to l - 1 do
105
- let c = s.[k] in
106
- if is_slash c then (
107
- --- ./src/findlib/frontend.ml
108
- +++ ./src/findlib/frontend.ml
109
- @@ -31,10 +31,18 @@
110
- else
111
- Sys_error (arg ^ ": " ^ Unix.error_message code)
112
-
113
- +let is_win = Sys.os_type = "Win32"
114
- +
115
- +let () =
116
- + match Findlib_config.system with
117
- + | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" ->
118
- + (try set_binary_mode_out stdout true with _ -> ());
119
- + (try set_binary_mode_out stderr true with _ -> ());
120
- + | _ -> ()
121
-
122
- let slashify s =
123
- match Findlib_config.system with
124
- - | "mingw" | "mingw64" | "cygwin" ->
125
- + | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" ->
126
- let b = Buffer.create 80 in
127
- String.iter
128
- (function
129
- @@ -49,7 +57,7 @@
130
-
131
- let out_path ?(prefix="") s =
132
- match Findlib_config.system with
133
- - | "mingw" | "mingw64" | "cygwin" ->
134
- + | "win32" | "win64" | "mingw" | "mingw64" | "cygwin" ->
135
- let u = slashify s in
136
- prefix ^
137
- (if String.contains u ' ' then
138
- @@ -273,11 +281,9 @@
139
-
140
-
141
- let identify_dir d =
142
- - match Sys.os_type with
143
- - | "Win32" ->
144
- - failwith "identify_dir" (* not available *)
145
- - | _ ->
146
- - let s = Unix.stat d in
147
- + if is_win then
148
- + failwith "identify_dir"; (* not available *)
149
- + let s = Unix.stat d in
150
- (s.Unix.st_dev, s.Unix.st_ino)
151
- ;;
152
-
153
- @@ -459,6 +465,96 @@
154
- )
155
- packages
156
-
157
- +let rewrite_cmd s =
158
- + if s = "" || not is_win then
159
- + s
160
- + else
161
- + let s =
162
- + let l = String.length s in
163
- + let b = Buffer.create l in
164
- + for i = 0 to pred l do
165
- + match s.[i] with
166
- + | '/' -> Buffer.add_char b '\\'
167
- + | x -> Buffer.add_char b x
168
- + done;
169
- + Buffer.contents b
170
- + in
171
- + if (Filename.is_implicit s && String.contains s '\\' = false) ||
172
- + Filename.check_suffix (String.lowercase s) ".exe" then
173
- + s
174
- + else
175
- + let s' = s ^ ".exe" in
176
- + if Sys.file_exists s' then
177
- + s'
178
- + else
179
- + s
180
- +
181
- +let rewrite_cmd s =
182
- + if s = "" || not is_win then s else
183
- + let s =
184
- + let l = String.length s in
185
- + let b = Buffer.create l in
186
- + for i = 0 to pred l do
187
- + match s.[i] with
188
- + | '/' -> Buffer.add_char b '\\'
189
- + | x -> Buffer.add_char b x
190
- + done;
191
- + Buffer.contents b
192
- + in
193
- + if (Filename.is_implicit s && String.contains s '\\' = false) ||
194
- + Filename.check_suffix (String.lowercase s) ".exe" then
195
- + s
196
- + else
197
- + let s' = s ^ ".exe" in
198
- + if Sys.file_exists s' then
199
- + s'
200
- + else
201
- + s
202
- +
203
- +let rewrite_pp cmd =
204
- + if not is_win then cmd else
205
- + let module T = struct exception Keep end in
206
- + let is_whitespace = function
207
- + | ' ' | '\011' | '\012' | '\n' | '\r' | '\t' -> true
208
- + | _ -> false in
209
- + (* characters that triggers special behaviour (cmd.exe, not unix shell) *)
210
- + let is_unsafe_char = function
211
- + | '(' | ')' | '%' | '!' | '^' | '<' | '>' | '&' -> true
212
- + | _ -> false in
213
- + let len = String.length cmd in
214
- + let buf = Buffer.create (len + 4) in
215
- + let buf_cmd = Buffer.create len in
216
- + let rec iter_ws i =
217
- + if i >= len then () else
218
- + let cur = cmd.[i] in
219
- + if is_whitespace cur then (
220
- + Buffer.add_char buf cur;
221
- + iter_ws (succ i)
222
- + )
223
- + else
224
- + iter_cmd i
225
- + and iter_cmd i =
226
- + if i >= len then add_buf_cmd () else
227
- + let cur = cmd.[i] in
228
- + if is_unsafe_char cur || cur = '"' || cur = '\'' then
229
- + raise T.Keep;
230
- + if is_whitespace cur then (
231
- + add_buf_cmd ();
232
- + Buffer.add_substring buf cmd i (len - i)
233
- + )
234
- + else (
235
- + Buffer.add_char buf_cmd cur;
236
- + iter_cmd (succ i)
237
- + )
238
- + and add_buf_cmd () =
239
- + if Buffer.length buf_cmd > 0 then
240
- + Buffer.add_string buf (rewrite_cmd (Buffer.contents buf_cmd))
241
- + in
242
- + try
243
- + iter_ws 0;
244
- + Buffer.contents buf
245
- + with
246
- + | T.Keep -> cmd
247
-
248
- let process_pp_spec syntax_preds packages pp_opts =
249
- (* Returns: pp_command *)
250
- @@ -549,7 +645,7 @@
251
- None -> []
252
- | Some cmd ->
253
- ["-pp";
254
- - cmd ^ " " ^
255
- + (rewrite_cmd cmd) ^ " " ^
256
- String.concat " " (List.map Filename.quote pp_i_options) ^ " " ^
257
- String.concat " " (List.map Filename.quote pp_archives) ^ " " ^
258
- String.concat " " (List.map Filename.quote pp_opts)]
259
- @@ -625,9 +721,11 @@
260
- in
261
- try
262
- let preprocessor =
263
- + rewrite_cmd (
264
- resolve_path
265
- ~base ~explicit:true
266
- - (package_property predicates pname "ppx") in
267
- + (package_property predicates pname "ppx") )
268
- + in
269
- ["-ppx"; String.concat " " (preprocessor :: options)]
270
- with Not_found -> []
271
- )
272
- @@ -895,6 +993,14 @@
273
- switch (e.g. -L<path> instead of -L <path>)
274
- *)
275
-
276
- +(* We may need to remove files on which we do not have complete control.
277
- + On Windows, removing a read-only file fails so try to change the
278
- + mode of the file first. *)
279
- +let remove_file fname =
280
- + try Sys.remove fname
281
- + with Sys_error _ when is_win ->
282
- + (try Unix.chmod fname 0o666 with Unix.Unix_error _ -> ());
283
- + Sys.remove fname
284
-
285
- let ocamlc which () =
286
-
287
- @@ -1022,9 +1128,12 @@
288
-
289
- "-intf",
290
- Arg.String (fun s -> pass_files := !pass_files @ [ Intf(slashify s) ]);
291
- -
292
- +
293
- "-pp",
294
- - Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s);
295
- + Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" (rewrite_pp s));
296
- +
297
- + "-ppx",
298
- + Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s));
299
-
300
- "-thread",
301
- Arg.Unit (fun _ -> threads := threads_default);
302
- @@ -1237,7 +1346,7 @@
303
- with
304
- any ->
305
- close_out initl;
306
- - Sys.remove initl_file_name;
307
- + remove_file initl_file_name;
308
- raise any
309
- end;
310
-
311
- @@ -1245,9 +1354,9 @@
312
- at_exit
313
- (fun () ->
314
- let tr f x = try f x with _ -> () in
315
- - tr Sys.remove initl_file_name;
316
- - tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmi");
317
- - tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmo");
318
- + tr remove_file initl_file_name;
319
- + tr remove_file (Filename.chop_extension initl_file_name ^ ".cmi");
320
- + tr remove_file (Filename.chop_extension initl_file_name ^ ".cmo");
321
- );
322
-
323
- let exclude_list = [ stdlibdir; threads_dir; vmthreads_dir ] in
324
- @@ -1493,7 +1602,9 @@
325
- [ "-v", Arg.Unit (fun () -> verbose := Verbose);
326
- "-pp", Arg.String (fun s ->
327
- pp_specified := true;
328
- - options := !options @ ["-pp"; s]);
329
- + options := !options @ ["-pp"; rewrite_pp s]);
330
- + "-ppx", Arg.String (fun s ->
331
- + options := !options @ ["-ppx"; rewrite_pp s]);
332
- ]
333
- )
334
- )
335
- @@ -1672,7 +1783,9 @@
336
- Arg.String (fun s -> add_spec_fn "-I" (slashify (resolve_path s)));
337
-
338
- "-pp", Arg.String (fun s -> pp_specified := true;
339
- - add_spec_fn "-pp" s);
340
- + add_spec_fn "-pp" (rewrite_pp s));
341
- + "-ppx", Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s));
342
- +
343
- ]
344
- )
345
- )
346
- @@ -1830,7 +1943,10 @@
347
- output_string ch_out append;
348
- close_out ch_out;
349
- close_in ch_in;
350
- - Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime;
351
- + (try Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime
352
- + with Unix.Unix_error(e,_,_) ->
353
- + prerr_endline("Warning: setting utimes for " ^ outpath
354
- + ^ ": " ^ Unix.error_message e));
355
-
356
- prerr_endline("Installed " ^ outpath);
357
- with
358
- @@ -1882,6 +1998,8 @@
359
- Unix.openfile (Filename.concat dir owner_file) [Unix.O_RDONLY] 0 in
360
- let f =
361
- Unix.in_channel_of_descr fd in
362
- + if is_win then
363
- + set_binary_mode_in f false;
364
- try
365
- let line = input_line f in
366
- let is_my_file = (line = pkg) in
367
- @@ -2208,7 +2326,7 @@
368
- let lines = read_ldconf !ldconf in
369
- let dlldir_norm = Fl_split.norm_dir dlldir in
370
- let dlldir_norm_lc = string_lowercase_ascii dlldir_norm in
371
- - let ci_filesys = (Sys.os_type = "Win32") in
372
- + let ci_filesys = is_win in
373
- let check_dir d =
374
- let d' = Fl_split.norm_dir d in
375
- (d' = dlldir_norm) ||
376
- @@ -2356,7 +2474,7 @@
377
- List.iter
378
- (fun file ->
379
- let absfile = Filename.concat dlldir file in
380
- - Sys.remove absfile;
381
- + remove_file absfile;
382
- prerr_endline ("Removed " ^ absfile)
383
- )
384
- dll_files
385
- @@ -2365,7 +2483,7 @@
386
- (* Remove the files from the package directory: *)
387
- if Sys.file_exists pkgdir then begin
388
- let files = Sys.readdir pkgdir in
389
- - Array.iter (fun f -> Sys.remove (Filename.concat pkgdir f)) files;
390
- + Array.iter (fun f -> remove_file (Filename.concat pkgdir f)) files;
391
- Unix.rmdir pkgdir;
392
- prerr_endline ("Removed " ^ pkgdir)
393
- end
394
- @@ -2415,7 +2533,9 @@
395
-
396
-
397
- let print_configuration() =
398
- + let sl = slashify in
399
- let dir s =
400
- + let s = sl s in
401
- if Sys.file_exists s then
402
- s
403
- else
404
- @@ -2453,27 +2573,27 @@
405
- if md = "" then "the corresponding package directories" else dir md
406
- );
407
- Printf.printf "The standard library is assumed to reside in:\n %s\n"
408
- - (Findlib.ocaml_stdlib());
409
- + (sl (Findlib.ocaml_stdlib()));
410
- Printf.printf "The ld.conf file can be found here:\n %s\n"
411
- - (Findlib.ocaml_ldconf());
412
- + (sl (Findlib.ocaml_ldconf()));
413
- flush stdout
414
- | Some "conf" ->
415
- - print_endline (Findlib.config_file())
416
- + print_endline (sl (Findlib.config_file()))
417
- | Some "path" ->
418
- - List.iter print_endline (Findlib.search_path())
419
- + List.iter ( fun x -> print_endline (sl x)) (Findlib.search_path())
420
- | Some "destdir" ->
421
- - print_endline (Findlib.default_location())
422
- + print_endline ( sl (Findlib.default_location()))
423
- | Some "metadir" ->
424
- - print_endline (Findlib.meta_directory())
425
- + print_endline ( sl (Findlib.meta_directory()))
426
- | Some "metapath" ->
427
- let mdir = Findlib.meta_directory() in
428
- let ddir = Findlib.default_location() in
429
- - print_endline
430
- - (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META")
431
- + print_endline ( sl
432
- + (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META"))
433
- | Some "stdlib" ->
434
- - print_endline (Findlib.ocaml_stdlib())
435
- + print_endline ( sl (Findlib.ocaml_stdlib()))
436
- | Some "ldconf" ->
437
- - print_endline (Findlib.ocaml_ldconf())
438
- + print_endline ( sl (Findlib.ocaml_ldconf()))
439
- | _ ->
440
- assert false
441
- ;;
442
- @@ -2481,7 +2601,7 @@
443
-
444
- let ocamlcall pkg cmd =
445
- let dir = package_directory pkg in
446
- - let path = Filename.concat dir cmd in
447
- + let path = rewrite_cmd (Filename.concat dir cmd) in
448
- begin
449
- try Unix.access path [ Unix.X_OK ]
450
- with
451
- @@ -2647,6 +2767,10 @@
452
- | Sys_error f ->
453
- prerr_endline ("ocamlfind: " ^ f);
454
- exit 2
455
- + | Unix.Unix_error (e, fn, f) ->
456
- + prerr_endline ("ocamlfind: " ^ fn ^ " " ^ f
457
- + ^ ": " ^ Unix.error_message e);
458
- + exit 2
459
- | Findlib.No_such_package(pkg,info) ->
460
- prerr_endline ("ocamlfind: Package `" ^ pkg ^ "' not found" ^
461
- (if info <> "" then " - " ^ info else ""));
462
- --- ./src/findlib/Makefile
463
- +++ ./src/findlib/Makefile
464
- @@ -90,6 +90,7 @@
465
- cat findlib_config.mlp | \
466
- $(SH) $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \
467
- $(SH) $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \
468
- + $(SH) $(TOP)/tools/patch '@EXEC_SUFFIX@' '$(EXEC_SUFFIX)' | \
469
- sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \
470
- -e 's;@SYSTEM@;$(SYSTEM);g' \
471
- >findlib_config.ml
472
- --- ./src/findlib/frontend.ml
473
- +++ ./src/findlib/frontend.ml
474
- @@ -281,10 +281,8 @@
475
-
476
-
477
- let identify_dir d =
478
- - if is_win then
479
- - failwith "identify_dir"; (* not available *)
480
- let s = Unix.stat d in
481
- - (s.Unix.st_dev, s.Unix.st_ino)
482
- + (s.Unix.st_dev, s.Unix.st_ino)
483
- ;;
484
-
485
-
@@ -1,95 +0,0 @@
1
- #define CAML_NAME_SPACE
2
- #include <caml/mlvalues.h>
3
- #include <caml/fail.h>
4
- #include <caml/memory.h>
5
-
6
- #include "binaryen-c.h"
7
- #include "ocaml_helpers.h"
8
-
9
-
10
- /* Allocating an OCaml custom block to hold the given BinaryenHeapType */
11
- static value alloc_BinaryenHeapType(BinaryenHeapType typ)
12
- {
13
- value v = caml_alloc_custom(&binaryen_ops, sizeof(BinaryenHeapType), 0, 1);
14
- BinaryenHeapType_val(v) = typ;
15
- return v;
16
- }
17
-
18
-
19
- CAMLprim value
20
- caml_binaryen_heap_type_ext(value unit) {
21
- CAMLparam1(unit);
22
- BinaryenHeapType ty = BinaryenHeapTypeExt();
23
- CAMLreturn(alloc_BinaryenHeapType(ty));
24
- }
25
-
26
- CAMLprim value
27
- caml_binaryen_heap_type_func(value unit) {
28
- CAMLparam1(unit);
29
- BinaryenHeapType ty = BinaryenHeapTypeFunc();
30
- CAMLreturn(alloc_BinaryenHeapType(ty));
31
- }
32
-
33
- CAMLprim value
34
- caml_binaryen_heap_type_any(value unit) {
35
- CAMLparam1(unit);
36
- BinaryenHeapType ty = BinaryenHeapTypeAny();
37
- CAMLreturn(alloc_BinaryenHeapType(ty));
38
- }
39
-
40
- CAMLprim value
41
- caml_binaryen_heap_type_eq(value unit) {
42
- CAMLparam1(unit);
43
- BinaryenHeapType ty = BinaryenHeapTypeEq();
44
- CAMLreturn(alloc_BinaryenHeapType(ty));
45
- }
46
-
47
- CAMLprim value
48
- caml_binaryen_heap_type_i31(value unit) {
49
- CAMLparam1(unit);
50
- BinaryenHeapType ty = BinaryenHeapTypeI31();
51
- CAMLreturn(alloc_BinaryenHeapType(ty));
52
- }
53
-
54
- CAMLprim value
55
- caml_binaryen_heap_type_data(value unit) {
56
- CAMLparam1(unit);
57
- BinaryenHeapType ty = BinaryenHeapTypeData();
58
- CAMLreturn(alloc_BinaryenHeapType(ty));
59
- }
60
-
61
- CAMLprim value
62
- caml_binaryen_heap_type_string(value unit) {
63
- CAMLparam1(unit);
64
- BinaryenHeapType ty = BinaryenHeapTypeString();
65
- CAMLreturn(alloc_BinaryenHeapType(ty));
66
- }
67
-
68
- CAMLprim value
69
- caml_binaryen_heap_type_stringview_wtf8(value unit) {
70
- CAMLparam1(unit);
71
- BinaryenHeapType ty = BinaryenHeapTypeStringviewWTF8();
72
- CAMLreturn(alloc_BinaryenHeapType(ty));
73
- }
74
-
75
- CAMLprim value
76
- caml_binaryen_heap_type_stringview_wtf16(value unit) {
77
- CAMLparam1(unit);
78
- BinaryenHeapType ty = BinaryenHeapTypeStringviewWTF16();
79
- CAMLreturn(alloc_BinaryenHeapType(ty));
80
- }
81
-
82
- CAMLprim value
83
- caml_binaryen_heap_type_stringview_iter(value unit) {
84
- CAMLparam1(unit);
85
- BinaryenHeapType ty = BinaryenHeapTypeStringviewIter();
86
- CAMLreturn(alloc_BinaryenHeapType(ty));
87
- }
88
-
89
- CAMLprim value
90
- caml_binaryen_type_get_heap_type(value _ty) {
91
- CAMLparam1(_ty);
92
- BinaryenType ty = BinaryenType_val(_ty);
93
- BinaryenHeapType heapTy = BinaryenTypeGetHeapType(ty);
94
- CAMLreturn(alloc_BinaryenHeapType(heapTy));
95
- }
@@ -1,65 +0,0 @@
1
- //Provides: caml_binaryen_heap_type_ext
2
- //Requires: Binaryen
3
- function caml_binaryen_heap_type_ext() {
4
- return Binaryen._BinaryenHeapTypeExt();
5
- }
6
-
7
- //Provides: caml_binaryen_heap_type_func
8
- //Requires: Binaryen
9
- function caml_binaryen_heap_type_func() {
10
- return Binaryen._BinaryenHeapTypeFunc();
11
- }
12
-
13
- //Provides: caml_binaryen_heap_type_any
14
- //Requires: Binaryen
15
- function caml_binaryen_heap_type_any() {
16
- return Binaryen._BinaryenHeapTypeAny();
17
- }
18
-
19
- //Provides: caml_binaryen_heap_type_eq
20
- //Requires: Binaryen
21
- function caml_binaryen_heap_type_eq() {
22
- return Binaryen._BinaryenHeapTypeEq();
23
- }
24
-
25
- //Provides: caml_binaryen_heap_type_i31
26
- //Requires: Binaryen
27
- function caml_binaryen_heap_type_i31() {
28
- return Binaryen._BinaryenHeapTypeI31();
29
- }
30
-
31
- //Provides: caml_binaryen_heap_type_data
32
- //Requires: Binaryen
33
- function caml_binaryen_heap_type_data() {
34
- return Binaryen._BinaryenHeapTypeData();
35
- }
36
-
37
- //Provides: caml_binaryen_heap_type_string
38
- //Requires: Binaryen
39
- function caml_binaryen_heap_type_string() {
40
- return Binaryen._BinaryenHeapTypeString();
41
- }
42
-
43
- //Provides: caml_binaryen_heap_type_stringview_wtf8
44
- //Requires: Binaryen
45
- function caml_binaryen_heap_type_stringview_wtf8() {
46
- return Binaryen._BinaryenHeapTypeStringviewWTF8();
47
- }
48
-
49
- //Provides: caml_binaryen_heap_type_stringview_wtf16
50
- //Requires: Binaryen
51
- function caml_binaryen_heap_type_stringview_wtf16() {
52
- return Binaryen._BinaryenHeapTypeStringviewWTF16();
53
- }
54
-
55
- //Provides: caml_binaryen_heap_type_stringview_iter
56
- //Requires: Binaryen
57
- function caml_binaryen_heap_type_stringview_iter() {
58
- return Binaryen._BinaryenHeapTypeStringviewIter();
59
- }
60
-
61
- //Provides: caml_binaryen_type_get_heap_type
62
- //Requires: Binaryen
63
- function caml_binaryen_type_get_heap_type(typ) {
64
- return Binaryen._BinaryenTypeGetHeapType(typ);
65
- }