987e65a5b44560a649faf76f39365db7d11faf00
[sbcl.git] / src / cold / compile-cold-sbcl.lisp
1 ;;;; Compile the fundamental system sources (not CLOS, and possibly
2 ;;;; not some other warm-load-only stuff like DESCRIBE) to produce
3 ;;;; object files. Also set *TARGET-OBJECT-FILES* to all of their
4 ;;;; names.
5
6 ;;;; This software is part of the SBCL system. See the README file for
7 ;;;; more information.
8 ;;;;
9 ;;;; This software is derived from the CMU CL system, which was
10 ;;;; written at Carnegie Mellon University and released into the
11 ;;;; public domain. The software is in the public domain and is
12 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
13 ;;;; files for more information.
14
15 (in-package "SB-COLD")
16
17 (defvar *target-object-file-names*)
18
19 ;;; KLUDGE..
20 ;;;
21 ;;; CMU CL (as of 2.4.6 for Debian, anyway) issues warnings (and not
22 ;;; just STYLE-WARNINGs, either, alas) when it tries to interpret code
23 ;;; containing references to undefined functions. The most common
24 ;;; problem is that macroexpanded code refers to this function, which
25 ;;; isn't defined until late.
26 ;;;
27 ;;; This
28 ;;;   #+cmu (defun sb!kernel::arg-count-error (&rest rest)
29 ;;;           (error "stub version of ARG-COUNT-ERROR, rest=~S" rest))
30 ;;; doesn't work, with or without this
31 ;;;   (compile 'sb!kernel::arg-count-error))
32 ;;; so perhaps I should try
33 ;;;   (declaim (ftype ..) ..)
34 ;;; instead?
35 (declaim (ftype (function (&rest t) nil) sb!kernel::arg-count-error))
36
37 (let ((reversed-target-object-file-names nil))
38   (do-stems-and-flags (stem flags)
39     (unless (position :not-target flags)
40       (push (target-compile-stem stem
41                                  :assem-p (find :assem flags)
42                                  :ignore-failure-p (find :ignore-failure-p
43                                                          flags))
44             reversed-target-object-file-names)
45       #!+sb-show (warn-when-cl-snapshot-diff *cl-snapshot*)))
46   (setf *target-object-file-names*
47         (nreverse reversed-target-object-file-names)))