Skip to content

Commit

Permalink
Init codegen during sysimg restore (#41676)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2fbeef8)
  • Loading branch information
maleadt authored and KristofferC committed Aug 2, 2021
1 parent e04e3e1 commit 3f5e41b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,12 +734,13 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel)
if (jl_options.cpu_target == NULL)
jl_options.cpu_target = "native";

if (jl_options.image_file)
if (jl_options.image_file) {
jl_restore_system_image(jl_options.image_file);
else
} else {
jl_init_types();
jl_init_codegen();
}

jl_init_codegen();
jl_init_common_symbols();
jl_init_flisp();
jl_init_serializer();
Expand Down
1 change: 1 addition & 0 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,7 @@ static void jl_restore_system_image_from_stream(ios_t *f) JL_GC_DISABLED
}

s.s = &sysimg;
jl_init_codegen();
jl_update_all_fptrs(&s); // fptr relocs and registration
// reinit ccallables, which require codegen to be initialized
s.s = f;
Expand Down

0 comments on commit 3f5e41b

Please sign in to comment.