diff options
author | mdenes <mdenes@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-02-24 11:54:28 +0000 |
---|---|---|
committer | mdenes <mdenes@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-02-24 11:54:28 +0000 |
commit | 0a9dd11b1500455bdc98ad5769e3a572a5705d8f (patch) | |
tree | 1b37e1d06f411ab79d62c683e04505c6778fe415 | |
parent | a19c384d3cc5b2b5539bd0df74d9e99cf95ebbc3 (diff) |
Reduced the noise level when dynlinking in bytecode mode or when
-no-native-compiler flag is on.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16239 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r-- | kernel/nativelib.ml | 8 | ||||
-rw-r--r-- | library/library.ml | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/kernel/nativelib.ml b/kernel/nativelib.ml index 09202f6a7..46125a2c7 100644 --- a/kernel/nativelib.ml +++ b/kernel/nativelib.ml @@ -77,15 +77,21 @@ let compile ml_filename code = write_ml_code ml_filename code; call_compiler ml_filename (!get_load_paths()) +(* call_linker dynamic links code for constants in environment or a *) +(* conversion test. Silently fails if the file does not exist in bytecode *) +(* mode, since the standard library is not compiled to bytecode with default *) +(* settings. *) let call_linker ~fatal prefix f upds = rt1 := dummy_value (); rt2 := dummy_value (); + if Dynlink.is_native || Sys.file_exists f then (try if Dynlink.is_native then Dynlink.loadfile f else !load_obj f; register_native_file prefix with | Dynlink.Error e -> let msg = "Dynlink error, " ^ Dynlink.error_message e in if fatal then anomaly (Pp.str msg) else Pp.msg_warning (Pp.str msg) - | _ -> let msg = "Dynlink error" in + | _ -> + let msg = "Dynlink error" in if fatal then anomaly (Pp.str msg) else Pp.msg_warning (Pp.str msg)); match upds with Some upds -> update_locations upds | _ -> () diff --git a/library/library.ml b/library/library.ml index 92104348e..9938333f2 100644 --- a/library/library.ml +++ b/library/library.ml @@ -222,7 +222,8 @@ let register_loaded_library m = let prefix = Nativecode.mod_uid_of_dirpath m.library_name ^ "." in let f = prefix ^ "cmo" in let f = Dynlink.adapt_filename f in - Nativelib.call_linker ~fatal:false prefix (Filename.concat dirname f) None + if not !Flags.no_native_compiler then + Nativelib.call_linker ~fatal:false prefix (Filename.concat dirname f) None in let rec aux = function | [] -> link m; [m] |