[cmucl-cvs] CMUCL commit: cross-sparc-branch src/tools/cross-scripts (cross-x86-sparc.lisp)

Raymond Toy rtoy at common-lisp.net
Thu Nov 18 00:22:33 UTC 2010


    Date: Wednesday, November 17, 2010 @ 19:22:33
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/tools/cross-scripts
     Tag: cross-sparc-branch

Modified: cross-x86-sparc.lisp

o Need to remove the :i486 feature from x86.  (Include :pentium too?)
o Add comments.
o Comment out debugging prints.


----------------------+
 cross-x86-sparc.lisp |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)


Index: src/tools/cross-scripts/cross-x86-sparc.lisp
diff -u src/tools/cross-scripts/cross-x86-sparc.lisp:1.1.2.1 src/tools/cross-scripts/cross-x86-sparc.lisp:1.1.2.2
--- src/tools/cross-scripts/cross-x86-sparc.lisp:1.1.2.1	Tue Nov 16 12:29:35 2010
+++ src/tools/cross-scripts/cross-x86-sparc.lisp	Wed Nov 17 19:22:33 2010
@@ -36,8 +36,10 @@
      )
    ;; Features to remove from current *features* here
    '(:sparc-v8 :sparc-v7		; Choose only one of :sparc-v7, :sparc-v8, :sparc-v9
-     ;; Other architectures we aren't using.
-     :x86 :x86-bootstrap :sse2 :x87
+     ;; Other architectures we aren't using.  Particularly important
+     ;; to get rid of sse2 and x87 so we don't accidentally try to
+     ;; compile the x87/sse2 float support on sparc, which won't work.
+     :x86 :x86-bootstrap :sse2 :x87 :i486
      :alpha :osf1 :mips
      ;; Really old stuff that should have been removed long ago.
      :propagate-fun-type :propagate-float-type :constrain-float-type
@@ -51,14 +53,21 @@
      :mp))
 
 ;;; Changes needed to bootstrap cross-compiling from x86 to sparc
+
+;; Set up the linkage space stuff appropriately for sparc.
 (setf (c::backend-foreign-linkage-space-start c::*target-backend*)
       #x0f800000
       (c::backend-foreign-linkage-entry-size c::*target-backend*)
       16)
 
 (in-package "LISP")
+;; We need the the fops because the cross-compiled fasl file is in
+;; big-endian order for sparc.  When we read in a string, we need to
+;; convert the big-endian string to little-endian for x86 so we can
+;; process the symbols and such as expected.
 (progn
 (defun maybe-swap-string (f name &optional (len (length name)))
+  (declare (ignorable f))
   (unless (eq (c:backend-byte-order c:*backend*)
 	      (c:backend-byte-order c:*native-backend*))
     (dotimes (k len)
@@ -66,7 +75,7 @@
 	(setf (aref name k)
 	      (code-char (logior (ash (ldb (byte 8 0) code) 8)
 				 (ldb (byte 8 8) code))))))
-    (format t "~S: new name = ~S~%" f name)
+    ;;(format t "~S: new name = ~S~%" f (subseq name 0 len))
     name))
 
 (macrolet ((frob (name code name-size package)
@@ -106,8 +115,7 @@
 
 (define-fop (fop-package 14)
   (let ((name (pop-stack)))
-    (format t "xfop-package: ~{~X~^ ~}~%" (map 'list #'char-code name))
-    ;; Byte swap name
+    ;;(format t "xfop-package: ~{~X~^ ~}~%" (map 'list #'char-code name))
     (or (find-package name)
 	(error (intl:gettext "The package ~S does not exist.") name))))
 
@@ -124,9 +132,9 @@
 (defun cold-load-symbol (size package)
   (let ((string (make-string size)))
     (read-n-bytes *fasl-file* string 0 (* 2 size))
-    (format t "xpre swap cold-load-symbol: ~S to package ~S~%" string package)
-    (maybe-byte-swap-string string)
-    (format t "xpost swap cold-load-symbol: ~S to package ~S~%" string package)
+    ;;(format t "xpre swap cold-load-symbol: ~S to package ~S~%" string package)
+    (maybe-swap-string 'cold-load-symbol string)
+    ;;(format t "xpost swap cold-load-symbol: ~S to package ~S~%" string package)
     (cold-intern (intern string package) package)))
 )
 




More information about the cmucl-cvs mailing list