From c941e174a726024a19fdc40a328b33e1b357f689 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Wed, 30 Jan 2008 18:16:20 +0000
Subject: [PATCH] Change fasl file version to #x19e.  Use boot-19e.lisp to make
 this change.  No cross-compile needed.

---
 bootfiles/19d/boot-19e.lisp | 63 +++++++++++++++++++++++++++++++++++++
 compiler/byte-comp.lisp     |  4 +--
 2 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 bootfiles/19d/boot-19e.lisp

diff --git a/bootfiles/19d/boot-19e.lisp b/bootfiles/19d/boot-19e.lisp
new file mode 100644
index 000000000..eb80b0731
--- /dev/null
+++ b/bootfiles/19d/boot-19e.lisp
@@ -0,0 +1,63 @@
+;;;;
+;;;; Boot file for changing the fasl file version numbers to 19e.
+;;;;
+
+(in-package :c)
+
+(setf lisp::*enable-package-locked-errors* nil)
+
+;;;
+;;; Note that BYTE-FASL-FILE-VERSION is a constant.
+;;;
+;;; (Be sure to change BYTE-FASL-FILE-VERSION in
+;;; compiler/byte-comp.lisp to the correct value too!)
+;;;
+(setf (symbol-value 'byte-fasl-file-version)       #x19e)
+(setf (backend-fasl-file-version *target-backend*) #x19e)
+
+;;;
+;;; Don't check fasl versions in the compiling Lisp because we'll
+;;; load files compiled with the new version numbers.
+;;;
+(setq lisp::*skip-fasl-file-version-check* t)
+
+;;;
+;;; This is here because BYTE-FASL-FILE-VERSION is constant-folded in
+;;; OPEN-FASL-FILE.  To make the new version number take effect, we
+;;; have to redefine the function.
+;;;
+(defun open-fasl-file (name where &optional byte-p)
+  (declare (type pathname name))
+  (let* ((stream (open name :direction :output
+		       :if-exists :new-version
+		       :element-type '(unsigned-byte 8)))
+	 (res (make-fasl-file :stream stream)))
+    (multiple-value-bind
+	(version f-vers f-imp)
+	(if byte-p
+	    (values "Byte code"
+		    byte-fasl-file-version
+		    (backend-byte-fasl-file-implementation *backend*))
+	    (values (backend-version *backend*)
+		    (backend-fasl-file-version *backend*)
+		    (backend-fasl-file-implementation *backend*)))
+      (format stream
+	      "FASL FILE output from ~A.~@
+	       Compiled ~A on ~A~@
+	       Compiler ~A, Lisp ~A~@
+	       Targeted for ~A, FASL version ~X~%"
+	      where
+	      (ext:format-universal-time nil (get-universal-time))
+	      (machine-instance) compiler-version
+	      (lisp-implementation-version)
+	      version f-vers)
+      ;;
+      ;; Terminate header.
+      (dump-byte 255 res)
+      ;;
+      ;; Specify code format.
+      (dump-fop 'lisp::fop-long-code-format res)
+      (dump-byte f-imp res)
+      (dump-unsigned-32 f-vers res))
+    res))
+
diff --git a/compiler/byte-comp.lisp b/compiler/byte-comp.lisp
index 6276e9c8e..dc816a8bc 100644
--- a/compiler/byte-comp.lisp
+++ b/compiler/byte-comp.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/byte-comp.lisp,v 1.45 2006/11/13 15:36:29 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/byte-comp.lisp,v 1.46 2008/01/30 18:16:20 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -32,7 +32,7 @@
 
 ;;;; Fasl file format:
 
-(defconstant byte-fasl-file-version #x19d)
+(defconstant byte-fasl-file-version #x19e)
 
 (let* ((version-string (format nil "~X" byte-fasl-file-version)))
   (sys:register-lisp-feature (intern (concatenate 'string "CMU" version-string) :keyword))
-- 
GitLab