From: William Harold Newman Date: Thu, 7 Jun 2001 17:15:54 +0000 (+0000) Subject: 0.6.12.24: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e88f9c7fd830938e1261cc424437905fb50179ae;p=sbcl.git 0.6.12.24: added a few tests as examples of what I'd like to have before merging the Mai/Atzmueller inline type test patches merged DB Alpha-dynamic-loading patches (sbcl-devel 2001-05-11) --- diff --git a/src/code/describe.lisp b/src/code/describe.lisp index 93c17f6..1b6f0f2 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -10,7 +10,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-IMPL") +(in-package "SB-IMPL") ;(SB-IMPL, not SB!IMPL, since we're built in warm load.) (declaim #.*optimize-byte-compilation*) diff --git a/src/code/force-delayed-defbangmethods.lisp b/src/code/force-delayed-defbangmethods.lisp index 2c64757..11eada3 100644 --- a/src/code/force-delayed-defbangmethods.lisp +++ b/src/code/force-delayed-defbangmethods.lisp @@ -7,7 +7,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-IMPL") +(in-package "SB-IMPL") ;(SB-IMPL, not SB!IMPL, since we're built in warm load.) (macrolet ((force-delayed-def!methods () `(progn diff --git a/src/code/foreign.lisp b/src/code/foreign.lisp index ee60295..ac0df23 100644 --- a/src/code/foreign.lisp +++ b/src/code/foreign.lisp @@ -1,4 +1,5 @@ -;;;; support for dynamically loading foreign object files +;;;; support for dynamically loading foreign object files and +;;;; resolving symbols therein ;;;; This software is part of the SBCL system. See the README file for ;;;; more information. @@ -9,7 +10,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-SYS") +(in-package "SB-SYS") ; (SB-SYS, not SB!SYS, since we're built in warm load.) (defun pick-temporary-file-name (&optional ;; KLUDGE: There are various security @@ -52,12 +53,16 @@ ;;; (On any OS which *does* support foreign object file loading, this ;;; placeholder implementation is overwritten by a subsequent real ;;; implementation.) +;;; +;;; You may want to use sb-sys:foreign-symbol-address instead of +;;; calling this directly; see code/target-load.lisp. (defun get-dynamic-foreign-symbol-address (symbol) (declare (type simple-string symbol) (ignore symbol)) nil) -;;; Linux implementation of GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS -;;; and functions (e.g. LOAD-FOREIGN) which affect it +;;; dlsym()-based implementation of GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS +;;; and functions (e.g. LOAD-FOREIGN) which affect it. This should +;;; work on any ELF system with dlopen(3) and dlsym(3) #+(or linux FreeBSD) (progn @@ -70,15 +75,16 @@ ; obj file were linked directly ; into the program)? -;;; a list of tables returned from dlopen(3) (or possibly some +;;; a list of handles returned from dlopen(3) (or possibly some ;;; bogus value temporarily during initialization) -(defvar *tables-from-dlopen* nil) +(defvar *handles-from-dlopen* nil) + ;;; Dynamically loaded stuff isn't there upon restoring from a save. ;;; Clearing the variable this way was originally done primarily for ;;; Irix, which resolves tzname at runtime, resulting in -;;; *TABLES-FROM-DLOPEN* being set in the saved core image, resulting -;;; in havoc upon restart; but it seems harmless and tidy for other -;;; OSes too. +;;; *HANDLES-FROM-DLOPEN* (which was then called *TABLES-FROM-DLOPEN*) +;;; being set in the saved core image, resulting in havoc upon +;;; restart; but it seems harmless and tidy for other OSes too. ;;; ;;; Of course, it can be inconvenient that dynamically loaded stuff ;;; goes away when we save and restore. However, @@ -91,7 +97,11 @@ ;;; dynamic loading of foreign files and saving/restoring cores, ;;; he probably has the sophistication to write his own after-save ;;; code to reload the libraries without much difficulty. -(push (lambda () (setq *tables-from-dlopen* nil)) + +;;; dan 2001.05.10 suspects that objection (1) is bogus for +;;; dlsym()-enabled systems + +(push (lambda () (setq *handles-from-dlopen* nil)) *after-save-initializations*) (defvar *dso-linker* "/usr/bin/ld") @@ -105,21 +115,26 @@ (name sb-c-call:c-string)) (sb-alien:def-alien-routine dlerror sb-c-call:c-string) -;;; Ensure that we've opened our own binary so we can resolve global -;;; variables in the Lisp image that come from libraries. This used to -;;; happen only in GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS, and only if no -;;; libraries were dlopen()ed already, but that didn't work if -;;; something was dlopen()ed before any problem global vars were used. -;;; So now we do this in any function that can add to the -;;; *TABLES-FROM-DLOPEN*, as well as in -;;; GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS. -(defun ensure-lisp-table-opened () - (unless *tables-from-dlopen* +;;; Ensure that we've opened our own binary so we can dynamically resolve +;;; symbols in the C runtime. + +;;; Old comment: This used to happen only in +;;; GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS, and only if no libraries were +;;; dlopen()ed already, but that didn't work if something was +;;; dlopen()ed before any problem global vars were used. So now we do +;;; this in any function that can add to the *HANDLES-FROM-DLOPEN*, as +;;; well as in GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS. + +;;; FIXME: It would work just as well to do it once at startup, actually. +;;; Then at least we know it's done. -dan 2001.05.10 + +(defun ensure-runtime-symbol-table-opened () + (unless *handles-from-dlopen* ;; Prevent recursive call if dlopen() isn't defined. - (setf *tables-from-dlopen* (int-sap 0)) - (setf *tables-from-dlopen* (list (dlopen nil rtld-lazy))) - (when (zerop (sb-sys:sap-int (first *tables-from-dlopen*))) - (error "can't open global symbol table: ~S" (dlerror))))) + (setf *handles-from-dlopen* (int-sap 0)) + (setf *handles-from-dlopen* (list (dlopen nil rtld-lazy))) + (when (zerop (sb-sys:sap-int (first *handles-from-dlopen*))) + (error "can't open our own binary's symbol table: ~S" (dlerror))))) (defun load-1-foreign (file) "the primitive upon which the more general LOAD-FOREIGN is built: load @@ -134,7 +149,7 @@ (DEF-ALIEN-ROUTINE SUMMISH INT (X INT) (Y INT)) Now running (SUMMISH 10 20) should return 31. " - (ensure-lisp-table-opened) + (ensure-runtime-symbol-table-opened) ;; Note: We use RTLD-GLOBAL so that it can find all the symbols ;; previously loaded. We use RTLD-NOW so that dlopen() will fail if ;; not all symbols are defined. @@ -142,11 +157,11 @@ (sap (dlopen real-file (logior rtld-now rtld-global)))) (if (zerop (sap-int sap)) (error "can't open object ~S: ~S" real-file (dlerror)) - (pushnew sap *tables-from-dlopen* :test #'sap=))) + (pushnew sap *handles-from-dlopen* :test #'sap=))) (values)) (defun get-dynamic-foreign-symbol-address (symbol) - (ensure-lisp-table-opened) + (ensure-runtime-symbol-table-opened) ;; Find the symbol in any of the loaded object files. Search in ;; reverse order of loading, so that later loadings take precedence. ;; @@ -154,11 +169,11 @@ ;; that the list isn't guaranteed to be in reverse order of loading, ;; at least not if a file is loaded more than once. Is this the ;; right thing? (In what cases does it matter?) - (dolist (table *tables-from-dlopen*) + (dolist (handle *handles-from-dlopen*) ;; KLUDGE: We implicitly exclude the possibility that the variable ;; could actually be NULL, but the man page for dlsym(3) ;; recommends doing a more careful test. -- WHN 20000825 - (let ((possible-result (sap-int (dlsym table symbol)))) + (let ((possible-result (sap-int (dlsym handle symbol)))) (unless (zerop possible-result) (return possible-result))))) diff --git a/src/code/inspect.lisp b/src/code/inspect.lisp index 5f9ce23..a9ee9f1 100644 --- a/src/code/inspect.lisp +++ b/src/code/inspect.lisp @@ -9,7 +9,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-IMPL") +(in-package "SB-IMPL") ;(SB-IMPL, not SB!IMPL, since we're built in warm load.) (declaim #.*optimize-byte-compilation*) diff --git a/src/code/load.lisp b/src/code/load.lisp index de45d75..e0ea324 100644 --- a/src/code/load.lisp +++ b/src/code/load.lisp @@ -358,6 +358,20 @@ (fill *fop-stack* nil :end *fop-stack-pointer-on-entry*) (fill *current-fop-table* nil))) t) + +;;; This is used in in target-load and also genesis, using +;;; *COLD-FOREIGN-SYMBOL-TABLE*. All the speculative prefix-adding +;;; code for foreign symbol lookup should be here. +(defun find-foreign-symbol-in-table (name table) + (let ((prefixes + #!+(or linux freebsd) #("" "ldso_stub__") + #!+openbsd #("" "_"))) + (some (lambda (prefix) + (gethash (concatenate 'string prefix name) + table + nil)) + prefixes))) + ;;;; stuff for debugging/tuning by collecting statistics on FOPs (?) diff --git a/src/code/ntrace.lisp b/src/code/ntrace.lisp index 3f72462..56573c8 100644 --- a/src/code/ntrace.lisp +++ b/src/code/ntrace.lisp @@ -9,7 +9,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-DEBUG") +(in-package "SB-DEBUG") ; (SB-, not SB!, since we're built in warm load.) ;;; FIXME: Why, oh why, doesn't the SB-DEBUG package use the SB-DI ;;; package? That would let us get rid of a whole lot of stupid diff --git a/src/code/profile.lisp b/src/code/profile.lisp index 57b3a5e..76c4ca5 100644 --- a/src/code/profile.lisp +++ b/src/code/profile.lisp @@ -7,7 +7,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-PROFILE") +(in-package "SB-PROFILE") ; (SB-, not SB!, since we're built in warm load.) ;;;; reading internal run time with high resolution and low overhead diff --git a/src/code/run-program.lisp b/src/code/run-program.lisp index c4cc515..b7fb7c8 100644 --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -10,7 +10,7 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB-IMPL") +(in-package "SB-IMPL") ;(SB-IMPL, not SB!IMPL, since we're built in warm load.) ;;;; hacking the Unix environment ;;;; diff --git a/src/code/target-load.lisp b/src/code/target-load.lisp index b47f4c4..ba43d46 100644 --- a/src/code/target-load.lisp +++ b/src/code/target-load.lisp @@ -38,7 +38,7 @@ (let ((results (multiple-value-list (eval sexpr)))) (load-fresh-line) (format t "~{~S~^, ~}~%" results)) - (eval sexpr)))) + (eval sexpr)))) ;;;; LOAD itself @@ -331,14 +331,12 @@ (declaim (ftype (function (string) sb!vm:word) foreign-symbol-address-as-integer)) + + +;;; sb!sys:get-dynamic-foreign-symbol-address is in foreign.lisp, on +;;; platforms that have dynamic loading (defun foreign-symbol-address-as-integer (foreign-symbol) - (or (gethash foreign-symbol *static-foreign-symbols*) - (gethash (concatenate 'simple-string - #!+linux "ldso_stub__" - #!+openbsd "_" - #!+freebsd "ldso_stub__" - foreign-symbol) - *static-foreign-symbols*) + (or (find-foreign-symbol-in-table foreign-symbol *static-foreign-symbols*) (sb!sys:get-dynamic-foreign-symbol-address foreign-symbol) (error "unknown foreign symbol: ~S" foreign-symbol))) diff --git a/src/compiler/generic/core.lisp b/src/compiler/generic/core.lisp index 3adbc7e..c36c2a3 100644 --- a/src/compiler/generic/core.lisp +++ b/src/compiler/generic/core.lisp @@ -57,7 +57,7 @@ (error "undefined assembler routine: ~S" name))) (:foreign (aver (stringp name)) - (or (sb!impl::foreign-symbol-address-as-integer name) + (or (foreign-symbol-address-as-integer name) (error "unknown foreign symbol: ~S"))) #!+x86 (:code-object diff --git a/src/compiler/generic/genesis.lisp b/src/compiler/generic/genesis.lisp index a552178..b75b246 100644 --- a/src/compiler/generic/genesis.lisp +++ b/src/compiler/generic/genesis.lisp @@ -62,6 +62,9 @@ ;;;; representation of spaces in the core +;;; If there is more than one dynamic space in memory (i.e., if a +;;; copying GC is in use), then only the active dynamic space gets +;;; dumped to core. (defvar *dynamic*) (defconstant dynamic-space-id 1) @@ -1343,7 +1346,7 @@ (write-wordindexed fdefn sb!vm:fdefn-raw-addr-slot (make-random-descriptor - (lookup-foreign-symbol "undefined_tramp")))) + (cold-foreign-symbol-address-as-integer "undefined_tramp")))) fdefn)))) (defun cold-fset (cold-name defn) @@ -1365,7 +1368,7 @@ sb!vm:word-shift)))) (#.sb!vm:closure-header-type (make-random-descriptor - (lookup-foreign-symbol "closure_tramp"))))) + (cold-foreign-symbol-address-as-integer "closure_tramp"))))) fdefn)) (defun initialize-static-fns () @@ -1396,7 +1399,9 @@ (defvar *cold-foreign-symbol-table*) (declaim (type hash-table *cold-foreign-symbol-table*)) -(defun load-foreign-symbol-table (filename) +;;; Read the sbcl.nm file to find the addresses for foreign-symbols in +;;; the C runtime. +(defun load-cold-foreign-symbol-table (filename) (with-open-file (file filename) (loop (let ((line (read-line file nil nil))) @@ -1444,40 +1449,15 @@ (setf (gethash name *cold-foreign-symbol-table*) value)))))) (values))) -;;; FIXME: the relation between #'lookup-foreign-symbol and -;;; #'lookup-maybe-prefix-foreign-symbol seems more than slightly -;;; illdefined - -(defun lookup-foreign-symbol (name) - #!+(or alpha x86) - (let ((prefixes - #!+linux #(;; FIXME: How many of these are actually - ;; needed? The first four are taken from rather - ;; disorganized CMU CL code, which could easily - ;; have had redundant values in it.. - "_" - "__" - "__libc_" - "ldso_stub__" - ;; ..and the fifth seems to match most - ;; actual symbols, at least in RedHat 6.2. - "") - #!+freebsd #("" "ldso_stub__") - #!+openbsd #("_"))) - (or (some (lambda (prefix) - (gethash (concatenate 'string prefix name) - *cold-foreign-symbol-table* - nil)) - prefixes) - *foreign-symbol-placeholder-value* - (progn - (format *error-output* "~&The foreign symbol table is:~%") - (maphash (lambda (k v) - (format *error-output* "~&~S = #X~8X~%" k v)) - *cold-foreign-symbol-table*) - (format *error-output* "~&The prefix table is: ~S~%" prefixes) - (error "The foreign symbol ~S is undefined." name)))) - #!-(or x86 alpha) (error "non-x86/alpha unsupported in SBCL (but see old CMU CL code)")) +(defun cold-foreign-symbol-address-as-integer (name) + (or (find-foreign-symbol-in-table name *cold-foreign-symbol-table*) + *foreign-symbol-placeholder-value* + (progn + (format *error-output* "~&The foreign symbol table is:~%") + (maphash (lambda (k v) + (format *error-output* "~&~S = #X~8X~%" k v)) + *cold-foreign-symbol-table*) + (error "The foreign symbol ~S is undefined." name)))) (defvar *cold-assembler-routines*) @@ -1652,12 +1632,16 @@ (when value (do-cold-fixup (second fixup) (third fixup) value (fourth fixup)))))) +;;; *COLD-FOREIGN-SYMBOL-TABLE* becomes *!INITIAL-FOREIGN-SYMBOLS* in +;;; the core. When the core is loaded, !LOADER-COLD-INIT uses this to +;;; create *STATIC-FOREIGN-SYMBOLS*, which the code in +;;; target-load.lisp refers to. (defun linkage-info-to-core () (let ((result *nil-descriptor*)) - (maphash #'(lambda (symbol value) - (cold-push (cold-cons (string-to-core symbol) - (number-to-core value)) - result)) + (maphash (lambda (symbol value) + (cold-push (cold-cons (string-to-core symbol) + (number-to-core value)) + result)) *cold-foreign-symbol-table*) (cold-set (cold-intern '*!initial-foreign-symbols*) result)) (let ((result *nil-descriptor*)) @@ -1669,9 +1653,12 @@ ;;;; general machinery for cold-loading FASL files -(defvar *cold-fop-functions* (replace (make-array 256) *fop-functions*) - #!+sb-doc - "FOP functions for cold loading") +;;; FOP functions for cold loading +(defvar *cold-fop-functions* + ;; We start out with a copy of the ordinary *FOP-FUNCTIONS*. The + ;; ones which aren't appropriate for cold load will be destructively + ;; modified. + (copy-seq *fop-functions*)) (defvar *normal-fop-functions*) @@ -2366,7 +2353,7 @@ (sym (make-string len))) (read-string-as-bytes *fasl-input-stream* sym) (let ((offset (read-arg 4)) - (value (lookup-foreign-symbol sym))) + (value (cold-foreign-symbol-address-as-integer sym))) (do-cold-fixup code-object offset value kind)) code-object)) @@ -2892,7 +2879,7 @@ initially undefined function references:~2%") ;; Read symbol table, if any. (when symbol-table-file-name - (load-foreign-symbol-table symbol-table-file-name)) + (load-cold-foreign-symbol-table symbol-table-file-name)) ;; Now that we've successfully read our only input file (by ;; loading the symbol table, if any), it's a good time to ensure diff --git a/src/runtime/Config.alpha-linux b/src/runtime/Config.alpha-linux index 73c6d78..7928947 100644 --- a/src/runtime/Config.alpha-linux +++ b/src/runtime/Config.alpha-linux @@ -14,11 +14,11 @@ LD = ld -taso LINKFLAGS = -v -g -Wl,-T -Wl,ld-script.alpha-linux NM = nm -p -ASSEM_SRC = alpha-assem.S #linux-stubs.S +ASSEM_SRC = alpha-assem.S ldso-stubs.S ARCH_SRC = alpha-arch.c -OS_SRC = linux-os.c os-common.c undefineds.c alpha-linux-os.c -LINKFLAGS+=-static -rdynamic +OS_SRC = linux-os.c alpha-linux-os.c os-common.c +LINKFLAGS+=-rdynamic # -static OS_LIBS= -ldl GC_SRC= gc.c diff --git a/src/runtime/alpha-arch.c b/src/runtime/alpha-arch.c index 4053163..861b5f2 100644 --- a/src/runtime/alpha-arch.c +++ b/src/runtime/alpha-arch.c @@ -116,7 +116,7 @@ void arch_set_pseudo_atomic_interrupted(os_context_t *context) /* [1] This behaviour can be changed with osf_setsysinfo, but cmucl * didn't use that */ -#ifdef linux +#ifdef __linux__ *os_context_register_addr(context,reg_ALLOC) |= (1L<<63); #else *os_context_register_addr(context,reg_ALLOC) |= 2; diff --git a/src/runtime/globals.h b/src/runtime/globals.h index 5b45181..84f0324 100644 --- a/src/runtime/globals.h +++ b/src/runtime/globals.h @@ -53,7 +53,7 @@ extern void globals_init(void); #endif /**/ #ifdef alpha -#ifdef linux +#ifdef __linux__ #define EXTERN(name,bytes) .globl name #endif #endif diff --git a/src/runtime/ldso-stubs.S b/src/runtime/ldso-stubs.S index f786dd0..fbfc0de 100644 --- a/src/runtime/ldso-stubs.S +++ b/src/runtime/ldso-stubs.S @@ -1,8 +1,14 @@ /* - * stubs for C-linkage library functions used by the runtime + * stubs for C-linkage library functions which we need to refer to + * from Lisp * - * These are needed because the locations of the libraries are - * filled in by the dynamic linker ld.so at runtime. + * These exist for the benefit of Lisp code that needs to refer to + * foreign symbols when dlsym() is not available (i.e. when dumping + * cold-sbcl.core, when we may be running in a host that's not SBCL, + * or on platforms that don't have it at all). If the runtime is + * dynamically linked, library functions won't be linked into it, so + * the map file won't show them. So, we need a bunch of stubs that + * nm(1) _can_ see. */ /* @@ -21,15 +27,34 @@ gcc2_compiled.: .text -#define LDSO_STUBIFY(fct) \ - .align 16 ; \ -.globl ldso_stub__ ## fct ; \ +#if defined __i386__ + +#define LDSO_STUBIFY(fct) \ + .align 16 ; \ +.globl ldso_stub__ ## fct ; \ .type ldso_stub__ ## fct,@function ; \ -ldso_stub__ ## fct: ; \ - jmp fct ; \ -.L ## fct ## e1: ; \ +ldso_stub__ ## fct: ; \ + jmp fct ; \ +.L ## fct ## e1: ; \ .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; +#elif defined alpha + + /* I _hope_ this is correct - I haven't checked in the manual + * yet. It works to the point of building and passing tests, + * at any rate - dan 2001.05.10 */ +#define LDSO_STUBIFY(fct) \ +.globl ldso_stub__ ## fct ; \ + .type ldso_stub__ ## fct,@function ; \ +ldso_stub__ ## fct: ; \ + jmp fct ; \ +.L ## fct ## e1: ; \ + .size ldso_stub__ ## fct,.L ## fct ## e1-ldso_stub__ ## fct ; + +#else +#error unsupported CPU architecture +#endif + LDSO_STUBIFY(accept) LDSO_STUBIFY(access) LDSO_STUBIFY(acos) @@ -134,3 +159,23 @@ ldso_stub__ ## fct: ; \ LDSO_STUBIFY(utimes) LDSO_STUBIFY(wait3) LDSO_STUBIFY(write) + +/* + * These aren't needed on the X86 because they're microcoded into the + * FPU, so the Lisp VOPs can implement them directly without having to + * call C code. + * + * Note: There might be some other functions in this category as well. + * E.g. I notice tanh() and acos() in the list above.. -- WHN 2001-06-07 + */ +#if !defined __i386__ + LDSO_STUBIFY(sin) + LDSO_STUBIFY(cos) + LDSO_STUBIFY(tan) + LDSO_STUBIFY(atan) + LDSO_STUBIFY(atan2) + LDSO_STUBIFY(exp) + LDSO_STUBIFY(log) + LDSO_STUBIFY(log10) + LDSO_STUBIFY(sqrt) +#endif \ No newline at end of file diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 7ef2691..9062ed5 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -65,7 +65,7 @@ * that SBCL runs on as of 0.6.7. If we port to the Alpha or some * other non-32-bit machine we'll probably need real machine-dependent * and OS-dependent definitions again. */ -#if ((defined alpha) && !(defined linux)) +#if ((defined alpha) && !(defined __linux__)) #error No u32,s32 definitions for this platform. Write some. #else /* int happens to be 4 bytes on linux/alpha. long is longer. */ diff --git a/src/runtime/undefineds.h b/src/runtime/undefineds.h index 503ac31..4211971 100644 --- a/src/runtime/undefineds.h +++ b/src/runtime/undefineds.h @@ -153,7 +153,7 @@ F(swapon) F(symlink) F(sync) F(syscall) -#if defined(hpux) || defined(SVR4) || defined(linux) +#if defined(hpux) || defined(SVR4) || defined(__linux__) F(closedir) F(opendir) #if defined(readdir) diff --git a/tests/type.impure.lisp b/tests/type.impure.lisp index 31b42e9..1036aff 100644 --- a/tests/type.impure.lisp +++ b/tests/type.impure.lisp @@ -97,5 +97,25 @@ (assert (subtypep 'ratio 'real)) (assert (subtypep 'ratio 'number)) +;;; Pierre Mai rewrote the CMU CL type test system to allow inline +;;; type tests for CONDITIONs and STANDARD-OBJECTs, and generally be +;;; nicer, and Martin Atzmueller ported the patches. They look nice +;;; but they're nontrivial enough that it's not obvious from +;;; inspection that everything is OK. Let's make sure that things +;;; still basically work. +(defstruct foo1) +(defstruct (foo2 (:include foo1)) + x) +(defstruct (foo3 (:include foo2))) +(defstruct (foo4 (:include foo3)) + y z) +(assert (typep (make-foo3) 'foo2)) +(assert (not (typep (make-foo1) 'foo4))) +(assert (null (ignore-errors (setf (foo2-x (make-foo1)) 11)))) +;;; (More tests here would be nice before merging the patches. More +;;; tests for STRUCTURE-OBJECT, tests for CONDITION, tests for +;;; STANDARD-OBJECT, compiled tests to make sure that the inline +;;; versions of the tests work..) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 71a7843..e009f94 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string like "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.12.23" +"0.6.12.24"