Fix (setf fdocumentation) on closures.
[sbcl.git] / make-host-1.lisp
blob5e35f0b74b14f758df019006c4d23bb9e26982c6
1 ;;; (We want to have some limit on print length and print level during
2 ;;; bootstrapping because PRINT-OBJECT only gets set up rather late,
3 ;;; and running without PRINT-OBJECT it's easy to fall into printing
4 ;;; enormous (or infinitely circular) low-level representations of
5 ;;; things.)
6 (setf *print-level* 5 *print-length* 5)
8 (progn (load "src/cold/shared.lisp")
9 (load "tools-for-build/ldso-stubs.lisp"))
10 (in-package "SB-COLD")
11 (progn
12 (setf *host-obj-prefix* "obj/from-host/")
13 (load "src/cold/set-up-cold-packages.lisp")
14 (load "src/cold/defun-load-or-cload-xcompiler.lisp")
16 ;; Supress function/macro redefinition warnings under clisp.
17 #+clisp (setf custom:*suppress-check-redefinition* t)
19 (defmacro maybe-with-compilation-unit (&body forms)
20 ;; A compilation-unit seems to kill the compile. I'm not sure if it's
21 ;; running out of memory or what. I don't care to find out,
22 ;; but it's most definitely the cause of the breakage.
23 #+clisp `(progn ,@forms)
25 #+sbcl
26 ;; Watch for deferred warnings under SBCL.
27 ;; UNDEFINED-VARIABLE does not cause COMPILE-FILE to return warnings-p
28 ;; unless outside a compilation unit. You find out about it only upon
29 ;; exit of SUMMARIZE-COMPILATION-UNIT. So we set up a handler for that.
30 `(let (fail)
31 (handler-bind (((and simple-warning (not style-warning))
32 (lambda (c)
33 ;; hack for PPC. See 'build-order.lisp-expr'
34 ;; Ignore the warning, and the warning about the warning.
35 (unless (or (search "not allowed by the operand type"
36 (simple-condition-format-control c))
37 (search "ignoring FAILURE-P return"
38 (simple-condition-format-control c)))
39 (setq fail t)))))
40 (with-compilation-unit () ,@forms))
41 (when fail
42 (error "make-host-1 stopped due to unexpected WARNING.")))
44 #-(or clisp sbcl) `(with-compilation-unit () ,@forms))
46 ;; Now we can set the #[+-] readers to our precautionary
47 ;; readers that prohibit use of ":sbcl" as the condition.
48 (set-dispatch-macro-character #\# #\+ #'she-reader)
49 (set-dispatch-macro-character #\# #\- #'she-reader))
51 (maybe-with-compilation-unit
52 (load-or-cload-xcompiler #'host-cload-stem)
54 ;;; Let's check that the type system, and various other things, are
55 ;;; reasonably sane. (It's easy to spend a long time wandering around
56 ;;; confused trying to debug cross-compilation if it isn't.)
57 (when (find :sb-test *shebang-features*)
58 (load "tests/type.before-xc.lisp")
59 (load "tests/info.before-xc.lisp")
60 (load "tests/vm.before-xc.lisp"))
61 ;; When building on a slow host using a slow Lisp,
62 ;; the wait time in slurp-ucd seems interminable - over a minute.
63 ;; Compiling seems to help a bit, but maybe it's my imagination.
64 (let ((object (compile-file "tools-for-build/ucd.lisp")))
65 (load object)
66 (delete-file object))
68 ;;; Generate character database tables.
69 (dolist (s '(sb-cold::slurp-ucd sb-cold::slurp-proplist sb-cold::output))
70 (funcall s))
72 ;;; propagate structure offset and other information to the C runtime
73 ;;; support code.
74 (host-cload-stem "src/compiler/generic/genesis" nil)
75 ) ; END with-compilation-unit
77 (sb!vm:genesis :c-header-dir-name "src/runtime/genesis")
78 #+cmu (ext:quit)
79 #+clisp (ext:quit)
80 #+abcl (ext:quit)