Skip to content

Commit 1b45fae

Browse files
committed
Revert "Refactor initialization slightly in cases where we have a handle"
This reverts commit cffc508.
1 parent cffc508 commit 1b45fae

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/init.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ JL_DLLEXPORT void *jl_libjulia_internal_handle;
383383
JL_DLLEXPORT void *jl_libjulia_handle;
384384
JL_DLLEXPORT void *jl_RTLD_DEFAULT_handle;
385385
JL_DLLEXPORT void *jl_exe_handle;
386-
JL_DLLEXPORT void *jl_image_handle = NULL;
387386
#ifdef _OS_WINDOWS_
388387
void *jl_ntdll_handle;
389388
void *jl_kernel32_handle;
@@ -873,12 +872,11 @@ static NOINLINE void _finish_julia_init(JL_IMAGE_SEARCH rel, jl_ptls_t ptls, jl_
873872

874873
// loads sysimg if available, and conditionally sets jl_options.cpu_target
875874
jl_image_buf_t sysimage = { JL_IMAGE_KIND_NONE };
876-
if (jl_image_handle) {
877-
sysimage = jl_set_sysimg_so(jl_image_handle);
878-
} else if (rel == JL_IMAGE_IN_MEMORY) {
875+
if (rel == JL_IMAGE_IN_MEMORY) {
879876
sysimage = jl_set_sysimg_so(jl_exe_handle);
880877
jl_options.image_file = jl_options.julia_bin;
881-
} else if (jl_options.image_file)
878+
}
879+
else if (jl_options.image_file)
882880
sysimage = jl_preload_sysimg(jl_options.image_file);
883881

884882
if (sysimage.kind == JL_IMAGE_KIND_SO)

src/julia_internal.h

-1
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,6 @@ JL_DLLEXPORT uint64_t jl_rand(void) JL_NOTSAFEPOINT;
15921592
JL_DLLEXPORT void jl_srand(uint64_t) JL_NOTSAFEPOINT;
15931593
JL_DLLEXPORT void jl_init_rand(void);
15941594

1595-
JL_DLLEXPORT extern void *jl_image_handle;
15961595
JL_DLLEXPORT extern void *jl_exe_handle;
15971596
JL_DLLEXPORT extern void *jl_libjulia_handle;
15981597
JL_DLLEXPORT extern void *jl_libjulia_internal_handle;

src/staticdata.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -3736,9 +3736,8 @@ JL_DLLEXPORT jl_image_buf_t jl_set_sysimg_so(void *handle)
37363736
{
37373737
if (jl_sysimage_buf.kind != JL_IMAGE_KIND_NONE)
37383738
return jl_sysimage_buf;
3739+
37393740
jl_sysimage_buf = get_image_buf(handle, /* is_pkgimage */ 0);
3740-
if (jl_image_handle == NULL)
3741-
jl_image_handle = handle;
37423741
return jl_sysimage_buf;
37433742
}
37443743

src/threading.c

-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ JL_DLLEXPORT jl_gcframe_t **jl_autoinit_and_adopt_thread(void)
456456
if (!jl_is_initialized()) {
457457
void *retaddr = __builtin_extract_return_addr(__builtin_return_address(0));
458458
void *handle = jl_find_dynamic_library_by_addr(retaddr, 0);
459-
jl_image_handle = handle;
460459
if (handle == NULL) {
461460
fprintf(stderr, "error: runtime auto-initialization failed due to bad sysimage lookup\n"
462461
" (this should not happen, please file a bug report)\n");

0 commit comments

Comments
 (0)