Created
January 2, 2012 04:47
-
-
Save sshirokov/1549389 to your computer and use it in GitHub Desktop.
A patch to help SBCL compiled cores find shared objects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(with-unlocked-packages (:sb-alien) | |
(let ((function (symbol-function 'sb-alien::try-reopen-shared-object))) | |
(setf (symbol-function 'sb-alien::try-reopen-shared-object) | |
#'(lambda (obj) | |
"Look at the pathname of the library we are trying to re-open | |
and only use the full absolute path if the named file exists. Otherwise reduce the | |
path to the minimal relative form and defer the search to the OS dynamic linker." | |
(declare (type sb-alien::shared-object obj)) | |
(let ((path (sb-alien::shared-object-pathname obj))) | |
(when (pathname-directory path) | |
(unless (probe-file path) | |
(let ((sub-path (make-pathname :name (pathname-name path) | |
:type (pathname-type path)))) | |
(setf (sb-alien::shared-object-pathname obj) sub-path | |
(sb-alien::shared-object-namestring obj) (namestring sub-path)))))) | |
(funcall function obj))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment