* Previously LOAD-SHARED-OBJECT looked for the shared object first
in the current directory, and if it existed there, it passed the
absolute pathname to dlopen().
New version passes the native namestring of the designated pathname,
absolute or relative -- which leads to dlopen() on some platforms not
looking in the current directory unless "." is in LD_LIBRARY_PATH.
So add TRUENAME calls to the test-suite when the .so lives there.
* Mention the change of semantics in NEWS.
* Delete trailing whitespace.
;;;; -*- coding: utf-8; -*-
changes in sbcl-1.0.22 relative to 1.0.21:
;;;; -*- coding: utf-8; -*-
changes in sbcl-1.0.22 relative to 1.0.21:
+ * minor incompatible change: LOAD-SHARED-OBJECT no longer by default looks
+ for the shared object in the current directory, but passes the native
+ namestring of the designated pathname to the operation system's shared
+ object loading function as-it.
* minor incompatible change: --disable-debugger toplevel option now takes
effect before processing of initialization files and --eval or --load
options.
* minor incompatible change: --disable-debugger toplevel option now takes
effect before processing of initialization files and --eval or --load
options.
:test #'equal))
(obj (or old (make-shared-object
:pathname pathname
:test #'equal))
(obj (or old (make-shared-object
:pathname pathname
- :namestring (native-namestring
+ :namestring (native-namestring
(translate-logical-pathname pathname)
:as-file t)))))
(setf (shared-object-dont-save obj) dont-save)
(translate-logical-pathname pathname)
:as-file t)))))
(setf (shared-object-dont-save obj) dont-save)
#+darwin "-bundle" #-darwin "-shared"
"-o" "stack-alignment-offset.so")
#+darwin "-bundle" #-darwin "-shared"
"-o" "stack-alignment-offset.so")
-(load-shared-object "stack-alignment-offset.so")
+(load-shared-object (truename "stack-alignment-offset.so"))
(define-alien-routine stack-alignment-offset int (alignment int))
(define-alien-routine trampoline int (callback (function int)))
(define-alien-routine stack-alignment-offset int (alignment int))
(define-alien-routine trampoline int (callback (function int)))
(eval-when (:compile-toplevel :load-toplevel :execute)
(handler-case
(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
(handler-case
(progn
- (load-shared-object "$TEST_FILESTEM.so")
- (load-shared-object "$TEST_FILESTEM-b.so"))
+ (load-shared-object (truename "$TEST_FILESTEM.so"))
+ (load-shared-object (truename "$TEST_FILESTEM-b.so")))
(sb-int:unsupported-operator ()
;; At least as of sbcl-0.7.0.5, LOAD-SHARED-OBJECT isn't
;; supported on every OS. In that case, there's nothing to test,
(sb-int:unsupported-operator ()
;; At least as of sbcl-0.7.0.5, LOAD-SHARED-OBJECT isn't
;; supported on every OS. In that case, there's nothing to test,
(note "/original definitions ok")
(rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak")
(rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so")
(note "/original definitions ok")
(rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak")
(rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so")
- (load-shared-object "$TEST_FILESTEM-b.so")
+ (load-shared-object (truename "$TEST_FILESTEM-b.so"))
(note "/reloading ok")
(assert (= 42 foo))
(assert (= 13 (bar)))
(note "/reloading ok")
(assert (= 42 foo))
(assert (= 13 (bar)))
(multiple-value-bind (val err) (ignore-errors (late-bar))
(assert (not val))
(assert (typep err 'undefined-alien-error)))
(multiple-value-bind (val err) (ignore-errors (late-bar))
(assert (not val))
(assert (typep err 'undefined-alien-error)))
- (load-shared-object "$TEST_FILESTEM-c.so")
+ (load-shared-object (truename "$TEST_FILESTEM-c.so"))
(assert (= 43 late-foo))
(assert (= 14 (late-bar)))
(note "/linkage table ok"))
(assert (= 43 late-foo))
(assert (= 14 (late-bar)))
(note "/linkage table ok"))
build_so $TEST_FILESTEM.addr.heap
run_sbcl <<EOF
build_so $TEST_FILESTEM.addr.heap
run_sbcl <<EOF
- (load-shared-object "$TEST_FILESTEM.addr.heap.so")
+ (load-shared-object (truename "$TEST_FILESTEM.addr.heap.so"))
(define-alien-type foo (struct foo (x int) (y int)))
(define-alien-variable a foo)
(define-alien-type foo (struct foo (x int) (y int)))
(define-alien-variable a foo)
"-dynamiclib" "-o" "threads-foreign.so" "threads-foreign.c")
(error "Missing shared library compilation options for this platform"))
:search t)
"-dynamiclib" "-o" "threads-foreign.so" "threads-foreign.c")
(error "Missing shared library compilation options for this platform"))
:search t)
-(sb-alien:load-shared-object "threads-foreign.so")
+(sb-alien:load-shared-object (truename "threads-foreign.so"))
(sb-alien:define-alien-routine loop-forever sb-alien:void)
(delete-file "threads-foreign.c")
(sb-alien:define-alien-routine loop-forever sb-alien:void)
(delete-file "threads-foreign.c")
-(load-shared-object "win32-stack-unwind.dll")
+(load-shared-object (truename "win32-stack-unwind.dll"))
(defvar *current-test-callback*)
(defvar *current-test-callback*)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)