X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcold%2Fshared.lisp;h=9fe9f42721b15dcd5363b335e52fbef601fbc7ee;hb=cfff13b268daf51fd05214b60e67a2b62f340d16;hp=20b519ac1ae161a4a5269a9e9e9dda61b67c4cca;hpb=242432ac5aa332bff0edfc519c80062cf8b61c93;p=sbcl.git diff --git a/src/cold/shared.lisp b/src/cold/shared.lisp index 20b519a..9fe9f42 100644 --- a/src/cold/shared.lisp +++ b/src/cold/shared.lisp @@ -46,7 +46,8 @@ ;; that we never explicitly refer to host object file suffixes, ;; only to the result of CL:COMPILE-FILE-PATHNAME. #+lispworks ".ufsl" ; as per Lieven Marchand sbcl-devel 2002-02-01 - #+openmcl ".pfsl" + #+(and openmcl (not darwin)) ".pfsl" + #+(and openmcl darwin) ".dfsl" ;; On most xc hosts, any old extension works, so we use an ;; arbitrary one. ".lisp-obj")) @@ -129,6 +130,7 @@ (src-prefix "") (src-suffix ".lisp") (compile-file #'compile-file) + trace-file ignore-failure-p) (declare (type function compile-file)) @@ -169,7 +171,13 @@ (setf tmp-obj ;; (Note that this idiom is taken from the ANSI ;; documentation for TRUENAME.) - (with-open-file (stream tmp-obj :direction :output) + (with-open-file (stream tmp-obj + :direction :output + ;; Compilation would overwrite the + ;; temporary object anyway and overly + ;; strict implementations default + ;; to :ERROR. + :if-exists :supersede) (close stream) (truename stream))) ;; and some compilers (e.g. OpenMCL) will complain if they're @@ -177,7 +185,7 @@ ;; recognizeably a fasl file), so (when (probe-file tmp-obj) (delete-file tmp-obj)) - + ;; Try to use the compiler to generate a new temporary object file. (flet ((report-recompile-restart (stream) (format stream "Recompile file ~S" src)) @@ -186,7 +194,10 @@ (tagbody retry-compile-file (multiple-value-bind (output-truename warnings-p failure-p) - (funcall compile-file src :output-file tmp-obj) + (if trace-file + (funcall compile-file src :output-file tmp-obj + :trace-file t) + (funcall compile-file src :output-file tmp-obj )) (declare (ignore warnings-p)) (cond ((not output-truename) (error "couldn't compile ~S" src)) @@ -294,6 +305,12 @@ ;; SBCL. ("not target code" -- but still presumably host code, ;; used to support the cross-compilation process) :not-target + ;; meaning: The #'COMPILE-STEM argument :TRACE-FILE should be T. + ;; When the compiler is SBCL's COMPILE-FILE or something like it, + ;; compiling "foo.lisp" will generate "foo.trace" which contains lots + ;; of exciting low-level information about representation selection, + ;; VOPs used by the compiler, and bits of assembly. + :trace-file ;; meaning: This file is to be processed with the SBCL assembler, ;; not COMPILE-FILE. (Note that this doesn't make sense unless ;; :NOT-HOST is also set, since the SBCL assembler doesn't exist @@ -311,7 +328,7 @@ (defparameter *stems-and-flags* (read-from-file "build-order.lisp-expr")) (defmacro do-stems-and-flags ((stem flags) &body body) - (let ((stem-and-flags (gensym "STEM-AND-FLAGS-"))) + (let ((stem-and-flags (gensym "STEM-AND-FLAGS"))) `(dolist (,stem-and-flags *stems-and-flags*) (let ((,stem (first ,stem-and-flags)) (,flags (rest ,stem-and-flags))) @@ -374,12 +391,13 @@ ;;; Run the cross-compiler on a file in the source directory tree to ;;; produce a corresponding file in the target object directory tree. -(defun target-compile-stem (stem &key assem-p ignore-failure-p) +(defun target-compile-stem (stem &key assem-p ignore-failure-p trace-file) (funcall *in-target-compilation-mode-fn* (lambda () (compile-stem stem :obj-prefix *target-obj-prefix* :obj-suffix *target-obj-suffix* + :trace-file trace-file :ignore-failure-p ignore-failure-p :compile-file (if assem-p *target-assemble-file*