0.7.9.56:
[sbcl/simd.git] / make-genesis-2.sh
blob551a34fcacaa0d2fc7f9de1aba350ca3abcecb06
1 #!/bin/sh
3 # This is a script to be run as part of make.sh. The only time you'd
4 # want to run it by itself is if you're trying to cross-compile the
5 # system or if you're doing some kind of troubleshooting.
7 # This software is part of the SBCL system. See the README file for
8 # more information.
10 # This software is derived from the CMU CL system, which was
11 # written at Carnegie Mellon University and released into the
12 # public domain. The software is in the public domain and is
13 # provided with absolutely no warranty. See the COPYING and CREDITS
14 # files for more information.
16 echo //entering make-genesis-2.sh
18 # In a fresh host Lisp invocation, load the cross-compiler (in order
19 # to get various definitions that GENESIS needs, not in order to
20 # cross-compile GENESIS, then load and run GENESIS. (We use a fresh
21 # host Lisp invocation here for basically the same reasons we did
22 # before when loading and running the cross-compiler.)
24 # (Why do we need this second invocation of GENESIS? In order to
25 # create a .core file, as opposed to just a .h file, GENESIS needs
26 # symbol table data on the C runtime. And we can get that symbol
27 # data only after the C runtime has been built. Therefore, even
28 # though we ran GENESIS earlier, we couldn't get it to make a .core
29 # file at that time; but we needed to run it earlier in order to
30 # get to where we can write a .core file.)
31 echo //loading and running GENESIS to create cold-sbcl.core
32 $SBCL_XC_HOST <<-'EOF' || exit 1
33 (setf *print-level* 5 *print-length* 5)
34 (load "src/cold/shared.lisp")
35 (in-package "SB-COLD")
36 (setf *host-obj-prefix* "obj/from-host/"
37 *target-obj-prefix* "obj/from-xc/")
38 (load "src/cold/set-up-cold-packages.lisp")
39 (load "src/cold/defun-load-or-cload-xcompiler.lisp")
40 (load-or-cload-xcompiler #'host-load-stem)
41 (defparameter *target-object-file-names*
42 (with-open-file (s "output/object-filenames-for-genesis.lisp-expr"
43 :direction :input)
44 (read s)))
45 (host-load-stem "src/compiler/generic/genesis")
46 (sb!vm:genesis :object-file-names *target-object-file-names*
47 :c-header-file-name "output/sbcl2.h"
48 :symbol-table-file-name "src/runtime/sbcl.nm"
49 :core-file-name "output/cold-sbcl.core"
50 ;; The map file is not needed by the system, but can
51 ;; be very handy when debugging cold init problems.
52 :map-file-name "output/cold-sbcl.map")
53 #+cmu (ext:quit)
54 EOF
56 echo //testing for consistency of first and second GENESIS passes
57 if cmp src/runtime/sbcl.h output/sbcl2.h; then
58 echo //sbcl2.h matches sbcl.h -- good.
59 else
60 echo error: sbcl2.h does not match sbcl.h.
61 exit 1