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
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")
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
)
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 (in-summary fail
)
31 (handler-bind (((and simple-warning
(not style-warning
))
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
'warning
))))
40 ;; Prevent regressions on a couple platforms
41 ;; that are known to build cleanly.
43 (sb-int:simple-style-warning
47 (simple-condition-format-control c
)))
48 (unless (eq fail
'warning
)
49 (setq fail
'style-warning
))))))
50 (with-compilation-unit ()
51 (multiple-value-prog1 (progn ,@forms
) (setq in-summary t
))))
53 (cerror "Proceed anyway"
54 "make-host-1 stopped due to unexpected ~A." fail
)))
56 #-
(or clisp sbcl
) `(with-compilation-unit () ,@forms
))
58 ;; Now we can set the #[+-] readers to our precautionary
59 ;; readers that prohibit use of ":sbcl" as the condition.
60 (set-dispatch-macro-character #\
# #\
+ #'she-reader
)
61 (set-dispatch-macro-character #\
# #\-
#'she-reader
))
63 (maybe-with-compilation-unit
64 (load-or-cload-xcompiler #'host-cload-stem
)
66 ;;; Let's check that the type system, and various other things, are
67 ;;; reasonably sane. (It's easy to spend a long time wandering around
68 ;;; confused trying to debug cross-compilation if it isn't.)
69 (when (find :sb-test
*shebang-features
*)
70 (load "tests/type.before-xc.lisp")
71 (load "tests/info.before-xc.lisp")
72 (load "tests/vm.before-xc.lisp"))
73 ;; When building on a slow host using a slow Lisp,
74 ;; the wait time in slurp-ucd seems interminable - over a minute.
75 ;; Compiling seems to help a bit, but maybe it's my imagination.
76 (let ((object (compile-file "tools-for-build/ucd.lisp")))
80 ;;; Generate character database tables.
81 (dolist (s '(sb-cold::slurp-ucd sb-cold
::slurp-proplist sb-cold
::output
))
84 ;;; propagate structure offset and other information to the C runtime
86 (host-cload-stem "src/compiler/generic/genesis" nil
)
87 ) ; END with-compilation-unit
89 (sb!vm
:genesis
:c-header-dir-name
"src/runtime/genesis")