[cffi-devel] %load-foreign-library on SBCL

Luís Oliveira luismbo at gmail.com
Sun Jun 14 17:29:06 UTC 2009


On Fri, Jun 12, 2009 at 9:24 PM, Elliott
Slaughter<elliottslaughter at gmail.com> wrote:
> I have a question about the implementation of %load-foreign-library on SBCL.
> It seems that the call to load-shared-object remembers the absolute pathname
> to the library that is loaded unless :dont-save t is used. This causes
> portability issues for my application, which can't load from the same path
> when used on different systems. Is there any reason to choose this behavior?

It'd say it's convenient to be able to save a core with FFI code and
have it just work. Ideally, we would try to reload libraries using all
of the alternatives specified through DEFINE-FOREIGN-LIBRARY, but
right now SBCL will use just the one that did succeed, IIRC.

So, if you succeed in loading "libfoo.so", SBCL will try to reload
that, not an absolute pathname.


> Of course, with :dont-save t, the user then has to call use-foreign-library
> again when starting up from the saved image, but I find this preferable to
> the crash I receive otherwise.

IIRC, you can close the foreign libraries before saving an image and
reload them manually afterwards. Would that be an acceptable
work-around?

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/




More information about the cffi-devel mailing list