mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 23:37:38 +02:00
WIP
This commit is contained in:
parent
a93c1e8cde
commit
a63fb1b1c7
2 changed files with 11 additions and 2 deletions
11
runtime.c
11
runtime.c
|
@ -5603,9 +5603,18 @@ void Cyc_import_shared_object(void *data, object cont, object filename, object e
|
||||||
Cyc_check_str(data, entry_pt_fnc);
|
Cyc_check_str(data, entry_pt_fnc);
|
||||||
handle = dlopen(string_str(filename), RTLD_LAZY);
|
handle = dlopen(string_str(filename), RTLD_LAZY);
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
Cyc_rt_raise2(data, "Unable to import library from", filename);
|
//make_string(s, dlerror());
|
||||||
|
fprintf(stderr, "%s\n", dlerror());
|
||||||
|
Cyc_rt_raise2(data, "Unable to import library", filename);
|
||||||
}
|
}
|
||||||
|
dlerror(); /* Clear any existing error */
|
||||||
|
|
||||||
entry_pt = (function_type) dlsym(handle, string_str(entry_pt_fnc));
|
entry_pt = (function_type) dlsym(handle, string_str(entry_pt_fnc));
|
||||||
|
if (entry_pt == NULL) {
|
||||||
|
//make_string(s, dlerror());
|
||||||
|
fprintf(stderr, "%s\n", dlerror());
|
||||||
|
Cyc_rt_raise2(data, "Unable to load symbol", entry_pt_fnc);
|
||||||
|
}
|
||||||
mclosure1(clo, entry_pt, cont);
|
mclosure1(clo, entry_pt, cont);
|
||||||
entry_pt(data, 0, &clo, &clo);
|
entry_pt(data, 0, &clo, &clo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -597,7 +597,7 @@
|
||||||
(c:dyn-load
|
(c:dyn-load
|
||||||
(lib:import->filename lib-name ".so")
|
(lib:import->filename lib-name ".so")
|
||||||
(string-append
|
(string-append
|
||||||
" c_" (lib:name->string lib-name) "_entry_pt_first_lambda"))))
|
"c_" (lib:name->string lib-name) "_entry_pt_first_lambda"))))
|
||||||
|
|
||||||
(define-c c:dyn-load
|
(define-c c:dyn-load
|
||||||
"(void *data, int argc, closure _, object k, object fn, object entry_fnc)"
|
"(void *data, int argc, closure _, object k, object fn, object entry_fnc)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue