Skip to content

Commit feb5cf2

Browse files
committed
Use jl_dlsym with search_deps=1 for ccalls
Reverts the behaviour change for ccalls introduced by JuliaLang#58815. This is motivated by libraries like MPI, where the dynamic library that actually defines a symbol is difficult to predict: JuliaParallel/MPI.jl#915 (comment)
1 parent 8349aed commit feb5cf2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/jitlayers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ struct JuliaOJIT::DLSymOptimizer {
17481748

17491749
void *lookup_symbol(void *libhandle, const char *fname) JL_NOTSAFEPOINT {
17501750
void *addr;
1751-
jl_dlsym(libhandle, fname, &addr, 0, 0);
1751+
jl_dlsym(libhandle, fname, &addr, 0, 1);
17521752
return addr;
17531753
}
17541754

src/runtime_ccall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void *jl_load_and_lookup(const char *f_lib, const char *f_name, _Atomic(void*) *
5959
if (!handle)
6060
jl_atomic_store_release(hnd, (handle = jl_get_library(f_lib)));
6161
void * ptr;
62-
jl_dlsym(handle, f_name, &ptr, 1, 0);
62+
jl_dlsym(handle, f_name, &ptr, 1, 1);
6363
return ptr;
6464
}
6565

@@ -80,7 +80,7 @@ void *jl_lazy_load_and_lookup(jl_value_t *lib_val, const char *f_name)
8080
} else
8181
jl_type_error("ccall", (jl_value_t*)jl_symbol_type, lib_val);
8282
void *ptr;
83-
jl_dlsym(lib_ptr, f_name, &ptr, 1, 0);
83+
jl_dlsym(lib_ptr, f_name, &ptr, 1, 1);
8484
return ptr;
8585
}
8686

0 commit comments

Comments
 (0)