+;; Older versions of SBCL forget their home directory when an image is
+;; dumped, so we must help this one to remember.
+etch-sbcl-home =
+ (let* ((#100=#:sfs (find-symbol "*STATIC-FOREIGN-SYMBOLS*" "SB-IMPL"))
+ (#101=#:shp (find-symbol "SBCL-HOMEDIR-PATHNAME" "SB-IMPL")))
+ (unless (or (not #100#) (not #101#)
+ (gethash "sbcl_home" (symbol-value #100#)))
+ (#+sb-package-locks without-package-locks
+ #-sb-package-locks progn
+ (setf (symbol-function #101#)
+ (let ((#102=#:etched-sbcl-home (funcall #101#)))
+ (lambda () #102#))))))
+