aboutsummaryrefslogtreecommitdiff
path: root/kernel/nativelib.ml
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/nativelib.ml')
-rw-r--r--kernel/nativelib.ml24
1 files changed, 7 insertions, 17 deletions
diff --git a/kernel/nativelib.ml b/kernel/nativelib.ml
index 31ad364911..833e4082f0 100644
--- a/kernel/nativelib.ml
+++ b/kernel/nativelib.ml
@@ -11,7 +11,6 @@ open Util
open Nativevalues
open Nativecode
open CErrors
-open Envars
(** This file provides facilities to access OCaml compiler and dynamic linker,
used by the native compiler. *)
@@ -37,10 +36,10 @@ let ( / ) = Filename.concat
(* We have to delay evaluation of include_dirs because coqlib cannot be guessed
until flags have been properly initialized *)
let include_dirs () =
- [Filename.get_temp_dir_name (); coqlib () / "kernel"; coqlib () / "library"]
+ [Filename.get_temp_dir_name (); Envars.coqlib () / "kernel"; Envars.coqlib () / "library"]
(* Pointer to the function linking an ML object into coq's toplevel *)
-let load_obj = ref (fun x -> () : string -> unit)
+let load_obj = ref (fun _x -> () : string -> unit)
let rt1 = ref (dummy_value ())
let rt2 = ref (dummy_value ())
@@ -88,16 +87,7 @@ let call_compiler ?profile:(profile=false) ml_filename =
else
[]
in
- let flambda_args =
- if Coq_config.caml_version_nums >= [4;3;0] && Dynlink.is_native then
- (* We play safe for now, and use the native compiler
- with -Oclassic, however it is likely that `native_compute`
- users can benefit from tweaking here.
- *)
- ["-Oclassic"]
- else
- []
- in
+ let flambda_args = if Sys.(backend_type = Native) then ["-Oclassic"] else [] in
let args =
initial_args @
profile_args @
@@ -107,12 +97,12 @@ let call_compiler ?profile:(profile=false) ml_filename =
::"-w"::"a"
::include_dirs) @
["-impl"; ml_filename] in
- if !Flags.debug then Feedback.msg_debug (Pp.str (ocamlfind () ^ " " ^ (String.concat " " args)));
+ if !Flags.debug then Feedback.msg_debug (Pp.str (Envars.ocamlfind () ^ " " ^ (String.concat " " args)));
try
- let res = CUnix.sys_command (ocamlfind ()) args in
+ let res = CUnix.sys_command (Envars.ocamlfind ()) args in
let res = match res with
| Unix.WEXITED 0 -> true
- | Unix.WEXITED n | Unix.WSIGNALED n | Unix.WSTOPPED n ->
+ | Unix.WEXITED _n | Unix.WSIGNALED _n | Unix.WSTOPPED _n ->
warn_native_compiler_failed (Inl res); false
in
res, link_filename
@@ -157,7 +147,7 @@ let call_linker ?(fatal=true) prefix f upds =
(try
if Dynlink.is_native then Dynlink.loadfile f else !load_obj f;
register_native_file prefix
- with Dynlink.Error e as exn ->
+ with Dynlink.Error _ as exn ->
let exn = CErrors.push exn in
if fatal then iraise exn
else if !Flags.debug then Feedback.msg_debug CErrors.(iprint exn));