Duane Rettig <firstname.lastname@example.org> wrote:
| email@example.com (Rob Warnock) writes:
| > Somebody posted some code here just recently to do *exactly* that...
| > From: Eric Marsden <firstname.lastname@example.org>
| > <http://www.google.com/groups?as_umsgid=wzin05x9wjt.fsf%40melbourne.laas.fr>
| > The function RELOAD-SHARED-LIBRARIES, which he cheerfully admits is
| > CMUCL-specific and nowhere near "supported".
| This looks correct, but there's still a piece missing (though CMUCL might
| already do this anyway): When a user does a
| dumplisp/save-image/whatever-it's-called-by-your-vendor the reborn
| lisp image should for the most part come back up the way it had been
| before. So all those loaded .so files should also be re-loaded if
| they exist...
No, CMUCL doesn't try to do this for you. In fact, there's a warning
in the CMUCL User's Manual in the section on the "Alien" FFI stuff:
8.6 Loading Unix Object Files
Foreign object files are loaded into the running Lisp process
Note that if a Lisp core image is saved (using SAVE-LISP),
all loaded foreign code is lost when the image is restarted.
[The same is equally true if you use the internal SYSTEM::LOAD-OBJECT-FILE
to load ".so" files directly, as some of us do...]
That said, though, CMUCL *does* provide an *AFTER-SAVE-INITIALIZATIONS*
hook -- "a list of functions which are called when a saved core image
starts up" -- so before saving the image you can push a closure onto
this hook to (re)load stuff for you.
| (this part is a stickler, since the dumped image might be moved
| to a different directory or even to a different machine, but it
| is resolvable, especially by using logical pathnames).
That helps, but varying versions of operating systems and/or system
libraries might create further portability problems, just as they do
with C programs that use shared libs.
| For Allegro CL, we have a FAQ entry, with the question "How does Lisp
| start up, in terms of shared-library linking and loading?" which is at
| Note specifically bullet 9 in the section labelled "The Startup Process".
Rob Warnock <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607