From fb5aa52ab8d870ee3613de325fbab7c98c33a433 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Mon, 2 Nov 2020 15:37:00 +0100 Subject: Remove the native symbol registering from the safe environment. Instead we store that data in the native code that was generated in adapt the compilation scheme accordingly. Less indirections and less imperative tinkering makes the code safer. The global symbol table was originally introduced in #10359 as a way not to depend on the Global module in the generated code. By storing all the native-related information in the cmxs file itself, this PR also makes other changes easier, such as e.g. #13287. --- kernel/nativelib.mli | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'kernel/nativelib.mli') diff --git a/kernel/nativelib.mli b/kernel/nativelib.mli index 29b4d20197..0c0fe3acc9 100644 --- a/kernel/nativelib.mli +++ b/kernel/nativelib.mli @@ -27,27 +27,24 @@ val get_ml_filename : unit -> string * string whether are in byte mode or not; file is expected to be .ml file *) val compile : string -> global list -> profile:bool -> string -(** [compile_library lib code file] is similar to [compile file code] +type native_library = Nativecode.global list * Nativevalues.symbols + +(** [compile_library (code, _) file] is similar to [compile file code] but will perform some extra tweaks to handle [code] as a Coq lib. *) -val compile_library : Names.DirPath.t -> global list -> string -> unit +val compile_library : native_library -> string -> unit val call_linker : ?fatal:bool - -> Environ.env -> prefix:string -> string -> code_location_updates option -> unit val link_library - : Environ.env - -> prefix:string + : prefix:string -> dirname:string -> basename:string -> unit val rt1 : Nativevalues.t ref val rt2 : Nativevalues.t ref - -val get_library_native_symbols : Names.DirPath.t -> Nativevalues.symbols -(** Strictly for usage by code produced by native compute. *) -- cgit v1.2.3