@@ -7709,7 +7709,7 @@ static jl_cgval_t emit_cfunction(jl_codectx_t &ctx, jl_value_t *output_type, con
7709
7709
7710
7710
// do codegen to create a C-callable alias/wrapper, or if sysimg_handle is set,
7711
7711
// restore one from a loaded system image.
7712
- const char *jl_generate_ccallable(Module *llvmmod, void *sysimg_handle, jl_value_t *nameval, jl_value_t *declrt, jl_value_t *sigt, jl_codegen_params_t ¶ms)
7712
+ const char *jl_generate_ccallable(Module *llvmmod, jl_value_t *nameval, jl_value_t *declrt, jl_value_t *sigt, jl_codegen_params_t ¶ms)
7713
7713
{
7714
7714
++GeneratedCCallables;
7715
7715
jl_datatype_t *ft = (jl_datatype_t*)jl_tparam0(sigt);
@@ -7738,25 +7738,12 @@ const char *jl_generate_ccallable(Module *llvmmod, void *sysimg_handle, jl_value
7738
7738
function_sig_t sig("cfunction", lcrt, crt, toboxed, false,
7739
7739
argtypes, NULL, false, CallingConv::C, false, ¶ms);
7740
7740
if (sig.err_msg.empty()) {
7741
- if (sysimg_handle) {
7742
- // restore a ccallable from the system image
7743
- void *addr;
7744
- int found = jl_dlsym(sysimg_handle, name, &addr, 0);
7745
- if (found)
7746
- add_named_global(name, addr);
7747
- else {
7748
- err = jl_get_exceptionf(jl_errorexception_type, "%s not found in sysimg", name);
7749
- jl_throw(err);
7750
- }
7751
- }
7752
- else {
7753
- //Safe b/c params holds context lock
7754
- Function *cw = gen_cfun_wrapper(llvmmod, params, sig, ff, name, declrt, sigt, NULL, NULL, NULL);
7755
- auto alias = GlobalAlias::create(cw->getValueType(), cw->getType()->getAddressSpace(),
7756
- GlobalValue::ExternalLinkage, name, cw, llvmmod);
7757
- if (params.TargetTriple.isOSBinFormatCOFF()) {
7758
- alias->setDLLStorageClass(GlobalValue::DLLStorageClassTypes::DLLExportStorageClass);
7759
- }
7741
+ //Safe b/c params holds context lock
7742
+ Function *cw = gen_cfun_wrapper(llvmmod, params, sig, ff, name, declrt, sigt, NULL, NULL, NULL);
7743
+ auto alias = GlobalAlias::create(cw->getValueType(), cw->getType()->getAddressSpace(),
7744
+ GlobalValue::ExternalLinkage, name, cw, llvmmod);
7745
+ if (params.TargetTriple.isOSBinFormatCOFF()) {
7746
+ alias->setDLLStorageClass(GlobalValue::DLLStorageClassTypes::DLLExportStorageClass);
7760
7747
}
7761
7748
JL_GC_POP();
7762
7749
return name;
0 commit comments