Consolidate the nine? three? two? implementations of WITH-PINNED-OBJECT
[sbcl.git] / make-target-2.sh
blob93497f0a7b89b33de7c80170907c96b9395ea43d
1 #!/bin/sh
2 set -em
4 # --load argument skips compilation.
6 # This is a script to be run as part of make.sh. The only time you'd
7 # want to run it by itself is if you're trying to cross-compile the
8 # system or if you're doing some kind of troubleshooting.
10 # This software is part of the SBCL system. See the README file for
11 # more information.
13 # This software is derived from the CMU CL system, which was
14 # written at Carnegie Mellon University and released into the
15 # public domain. The software is in the public domain and is
16 # provided with absolutely no warranty. See the COPYING and CREDITS
17 # files for more information.
19 echo //entering make-target-2.sh
21 LANG=C
22 LC_ALL=C
23 export LANG LC_ALL
25 # Load our build configuration
26 . output/build-config
28 if [ -n "$SBCL_HOST_LOCATION" ]; then
29 echo //copying host-2 files to target
30 rsync -a "$SBCL_HOST_LOCATION/output/" output/
33 # Do warm init stuff, e.g. building and loading CLOS, and stuff which
34 # can't be done until CLOS is running.
36 # Note that it's normal for the newborn system to think rather hard at
37 # the beginning of this process (e.g. using nearly 100Mb of virtual memory
38 # and >30 seconds of CPU time on a 450MHz CPU), and unless you built the
39 # system with the :SB-SHOW feature enabled, it does it rather silently,
40 # without trying to tell you about what it's doing. So unless it hangs
41 # for much longer than that, don't worry, it's likely to be normal.
42 if [ "$1" != --load ]; then
43 echo //doing warm init - compilation phase
44 echo '(load "loader.lisp") (load-sbcl-file "src/cold/warm.lisp")' | \
45 ./src/runtime/sbcl \
46 --core output/cold-sbcl.core \
47 --lose-on-corruption \
48 --no-sysinit --no-userinit
50 echo //doing warm init - load and dump phase
51 echo '(load "loader.lisp") (load-sbcl-file "make-target-2-load.lisp" nil)
52 (sb-ext:save-lisp-and-die "output/sbcl.core")' | \
53 ./src/runtime/sbcl \
54 --core output/cold-sbcl.core \
55 --lose-on-corruption \
56 --no-sysinit --no-userinit
58 echo //checking for leftover cold-init symbols
59 ./src/runtime/sbcl \
60 --core output/sbcl.core \
61 --lose-on-corruption \
62 --noinform \
63 --no-sysinit --no-userinit \
64 --eval '(restart-case
65 (let (l)
66 (sb-vm::map-allocated-objects
67 (lambda (obj type size)
68 (declare (ignore type size))
69 (when (and (symbolp obj) (not (symbol-package obj))
70 (search "!" (string obj)))
71 (push obj l)))
72 :all)
73 (format t "Found ~D:~%~S~%" (length l) l))
74 (abort ()
75 :report "Abort building SBCL."
76 (sb-ext:exit :code 1)))' \
77 --quit