X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fearly-fasl.lisp;h=15cf2d0ed34465246251ba3d5ac750646b81d6f5;hb=d48e55084636a84d1b54f1f7370fa98c55f3ec6e;hp=a6259dba4df3bffa71de49ee2eef5ac7064c28af;hpb=d40a76606c86722b0aef8179155f9f2840739b72;p=sbcl.git diff --git a/src/code/early-fasl.lisp b/src/code/early-fasl.lisp index a6259db..15cf2d0 100644 --- a/src/code/early-fasl.lisp +++ b/src/code/early-fasl.lisp @@ -33,75 +33,96 @@ ;;; against. (defparameter *fasl-header-string-start-string* "# FASL") +(macrolet ((define-fasl-format-features () + (let (;; master value for *F-P-A-F-F* + (fpaff '(:sb-thread))) + `(progn + ;; a list of *(SHEBANG-)FEATURES* flags which affect + ;; binary compatibility, i.e. which must be the same + ;; between the SBCL which compiles the code and the + ;; SBCL which executes the code + ;; + ;; This is a property of SBCL executables in the + ;; abstract, not of this particular SBCL executable, + ;; so any flag in this list may or may not be present + ;; in the *FEATURES* list of this particular build. + (defparameter *features-potentially-affecting-fasl-format* + ',fpaff) + ;; a string representing flags of *F-P-A-F-F* which + ;; are in this particular build + ;; + ;; (A list is the natural logical representation for + ;; this, but we represent it as a string because + ;; that's physically convenient for writing to and + ;; reading from fasl files, and because we don't + ;; need to do anything sophisticated with its + ;; logical structure, just test it for equality.) + (defparameter *features-affecting-fasl-format* + ,(let ((*print-pretty* nil)) + (prin1-to-string + (sort + (copy-seq + (intersection sb-cold:*shebang-features* fpaff)) + #'string< + :key #'symbol-name)))))))) + (define-fasl-format-features)) + ;;; the code for a character which terminates a fasl file header -(defconstant +fasl-header-string-stop-char-code+ 255) - -;;; This value should be incremented when the system changes in such -;;; a way that it will no longer work reliably with old fasl files. -(defconstant +fasl-file-version+ 21) -;;; 2 = sbcl-0.6.4 uses COMPILE-OR-LOAD-DEFGENERIC. -;;; 3 = sbcl-0.6.6 uses private symbol, not :EMPTY, for empty HASH-TABLE slot. -;;; 4 = sbcl-0.6.7 uses HAIRY-DATA-VECTOR-REF and HAIRY-DATA-VECTOR-SET -;;; when array headers or data element type uncertainty exist, and -;;; uses DATA-VECTOR-REF and DATA-VECTOR-SET only for VOPs. (Thus, -;;; full calls to DATA-VECTOR-REF and DATA-VECTOR-SET from older -;;; fasl files would fail, because there are no DEFUNs for these -;;; operations any more.) -;;; 5 = sbcl-0.6.8 has rearranged static symbols. -;;; 6 = sbcl-0.6.9, got rid of non-ANSI %DEFCONSTANT/%%DEFCONSTANT stuff -;;; and deleted a slot from DEBUG-SOURCE structure. -;;; 7 = around sbcl-0.6.9.8, merged SB-CONDITIONS package into SB-KERNEL -;;; 8 = sbcl-0.6.10.4 revived Gray stream support, changing stream layouts. -;;; 9 = deleted obsolete CONS-UNIQUE-TAG bytecode in sbcl-0.6.11.8 -;;; (somewhere in here also changes to AND and OR CTYPE layouts) -;;; 10 = new layout for CONDITION in sbcl-0.6.11.38 -;;; 11 = (a) new helper functions for MAKE-LOAD-FORM (HASH-TABLE) in -;;; sbcl-0.6.12.11 -;;; (b) new address space constants for OpenBSD in 0.6.12.17 -;;; (doesn't need separate version from (a) because the -;;; OpenBSD port was broken from sometime before 0.6.12.11 -;;; until the address space was changed) -;;; 12 = sbcl-0.6.12.22 added new SB-FASL package -;;; 13 = sbcl-0.6.12.28 removed some elements from *STATIC-SYMBOLS* -;;; 14 = sbcl-0.6.12.29 removed more elements from *STATIC-SYMBOLS* -;;; 15 = sbcl-0.6.12.33 changed the layout of STREAM -;;; 16 = sbcl-0.pre7.15 changed the layout of PRETTY-STREAM -;;; 17 = sbcl-0.pre7.38 (merging many changes accumulated in -;;; the sbcl-0.pre7.37.flaky5.* branch back into the main branch) -;;; got rid of byte compiler, byte interpreter, and IR1 -;;; interpreter, changed %DEFUN and DEFSTRUCT, changed the -;;; meaning of FOP-FSET, and changed the layouts of various -;;; internal compiler structures (e.g. DEFSTRUCT CLAMBDA) -;;; 18 = sbcl-0.pre7.39 swapped FUNCTION-POINTER-TYPE and -;;; INSTANCE-POINTER-LOWTAG low-level type codes to help with -;;; the PPC port -;;; (In 0.pre7.48, the low-level object layout of SYMBOL on the -;;; non-X86 ports changed. I forgot to bump the fasl version number: -;;; I only have an X86.. -- WHN) -;;; 19 = sbcl-0.pre7.50 deleted byte-compiler-related low-level type codes -;;; 20 = sbcl-0.pre7.51 modified names and layouts of -;;; physical-environment-related structures in the compiler -;;; 21 = sbcl-0.pre7.62 finally incremented the version after several -;;; incompatible changes in earlier versions: many many symbols -;;; renamed, changes in globaldb representation of constants -;;; and inline functions, and change in the value of -;;; INTERNAL-TIME-UNITS-PER-SECOND +(def!constant +fasl-header-string-stop-char-code+ 255) + +;;; This value should be incremented when the system changes in such a +;;; way that it will no longer work reliably with old fasl files. In +;;; practice, I (WHN) have often forgotten to increment it for CVS +;;; versions which break binary compatibility. But it certainly should +;;; be incremented for release versions which break binary +;;; compatibility. +(def!constant +fasl-file-version+ 49) +;;; (record of versions before 2003 deleted in 2003-04-26/0.pre8.107 or so) +;;; 38: (2003-01-05) changed names of internal SORT machinery +;;; 39: (2003-02-20) in 0.7.12.1 a slot was added to +;;; DEFSTRUCT-SLOT-DESCRIPTION +;;; 40: (2003-03-11) changed value of (SXHASH NIL) +;;; 41: (2003-04-26) enforced binary incompatibility between +SB-THREAD +;;; and -SB-THREAD builds +;;; 42: (2003-05-22) %NAME slot changed to NAME in +;;; DEFSTRUCT-SLOT-DESCRIPTION +;;; 43: (2003-07-18) Something could easily have changed incompatibly in +;;; recent maintenance, e.g. from (VECTOR NIL)-as-string support. +;;; (And experimental results suggest that compatibility was broken +;;; between about 0.8.1.29 and 0.8.1.39.) +;;; 44: (2003-08-25) various changes leading up to 0.8.3 +;;; what happened this month to stalate the fasls? +;;; I think I renumbered everything again +;;; simple-array-unsigned-byte-7, probably +;;; (thanks to pfdietz) +;;; 45: (2003-10-02) I (WHN) incremented the version for the 0.8.4 +;;; release because I couldn't immediately convince myself that +;;; .fasl files could never possibly ever refer to the SB-C +;;; CONTINUATION-related data types which were changed +;;; incompatibly in 0.8.3.62. +;;; 46: (2003-11-11) Tim Daly, Jr. (and Christophe Rhodes) reported +;;; .fasl incompatibility on sbcl-devel 2003-11-09. +;;; 47: (2003-11-30) Static variables were rearranged in 0.8.6.11. +;;; 48: (2004-03-01) Renumbered all the widetags to allow for more +;;; microefficiency in sbcl-0.8.8.10 +;;; 49: (2004-05-04) Changed implementation of DEFFOO macros and the +;;; functions they expand to. ;;; the conventional file extension for our fasl files (declaim (type simple-string *fasl-file-type*)) (defvar *fasl-file-type* "fasl") -;;; information about below-Lisp-level linkage -;;; +;;;; information about below-Lisp-level linkage + ;;; Note: ;;; Assembler routines are named by full Lisp symbols: they ;;; have packages and that sort of native Lisp stuff associated ;;; with them. We can compare them with EQ. -;;; Foreign symbols are named by Lisp strings: the Lisp package +;;; Foreign symbols are named by Lisp STRINGs: the Lisp package ;;; system doesn't extend out to symbols in languages like C. ;;; We want to use EQUAL to compare them. ;;; *STATIC-FOREIGN-SYMBOLS* are static as opposed to "dynamic" (not -;;; as opposed to "extern"). The table contains symbols known at +;;; as opposed to C's "extern"). The table contains symbols known at ;;; the time that the program was built, but not symbols defined ;;; in object files which have been loaded dynamically since then. (declaim (type hash-table *assembler-routines* *static-foreign-symbols*))