Update of /cvsroot/sbcl/sbcl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27243
Modified Files:
version.lisp-expr make-genesis-2.sh make-host-1.sh
make-host-2.sh make-target-2.sh
Added Files:
make-genesis-2.lisp make-host-1.lisp make-host-2.lisp
make-target-2.lisp
Log Message:
0.9.8.4:
Beginnings of a Win32 merge.
... rearrange the build scripts to use input from files rather
than <<HERE documents.
... (no other changes; just working to get the meaty changes
isolated from the fluff)
--- NEW FILE: make-genesis-2.lisp ---
(setf *print-level* 5 *print-length* 5)
(load "src/cold/shared.lisp")
(in-package "SB-COLD")
(setf *host-obj-prefix* "obj/from-host/"
*target-obj-prefix* "obj/from-xc/")
(load "src/cold/set-up-cold-packages.lisp")
(load "src/cold/defun-load-or-cload-xcompiler.lisp")
(load-or-cload-xcompiler #'host-load-stem)
(defparameter *target-object-file-names*
(with-open-file (s "output/object-filenames-for-genesis.lisp-expr"
:direction :input)
(read s)))
(host-load-stem "src/compiler/generic/genesis")
(sb!vm:genesis :object-file-names *target-object-file-names*
:c-header-dir-name "output/genesis-2"
:symbol-table-file-name "src/runtime/sbcl.nm"
:core-file-name "output/cold-sbcl.core"
;; The map file is not needed by the system, but can be
;; very handy when debugging cold init problems.
:map-file-name "output/cold-sbcl.map")
#+cmu (ext:quit)
#+clisp (ext:quit)
#+abcl (ext:quit)
--- NEW FILE: make-host-1.lisp ---
;;; (We want to have some limit on print length and print level during
;;; bootstrapping because PRINT-OBJECT only gets set up rather late,
;;; and running without PRINT-OBJECT it's easy to fall into printing
;;; enormous (or infinitely circular) low-level representations of
;;; things.)
(setf *print-level* 5 *print-length* 5)
(load "src/cold/shared.lisp")
(load "tools-for-build/ldso-stubs.lisp")
(in-package "SB-COLD")
(setf *host-obj-prefix* "obj/from-host/")
(load "src/cold/set-up-cold-packages.lisp")
(load "src/cold/defun-load-or-cload-xcompiler.lisp")
(load-or-cload-xcompiler #'host-cload-stem)
;;; Let's check that the type system, and various other things, are
;;; reasonably sane. (It's easy to spend a long time wandering around
;;; confused trying to debug cross-compilation if it isn't.)
(when (find :sb-test *shebang-features*)
(load "tests/type.before-xc.lisp")
(load "tests/info.before-xc.lisp")
(load "tests/vm.before-xc.lisp"))
(load "tools-for-build/ucd.lisp")
;;; Generate character database tables.
(sb-cold::slurp-ucd)
(sb-cold::output)
;;; propagate structure offset and other information to the C runtime
;;; support code.
(host-cload-stem "src/compiler/generic/genesis")
(sb!vm:genesis :c-header-dir-name "src/runtime/genesis")
#+cmu (ext:quit)
#+clisp (ext:quit)
#+abcl (ext:quit)
--- NEW FILE: make-host-2.lisp ---
;;; Set up the cross-compiler.
(setf *print-level* 5 *print-length* 5)
(load "src/cold/shared.lisp")
(in-package "SB-COLD")
;;; FIXME: these prefixes look like non-pathnamy ways of defining a
;;; relative pathname. Investigate whether they can be made relative
;;; pathnames.
(setf *host-obj-prefix* "obj/from-host/"
*target-obj-prefix* "obj/from-xc/")
(load "src/cold/set-up-cold-packages.lisp")
(load "src/cold/defun-load-or-cload-xcompiler.lisp")
(load-or-cload-xcompiler #'host-load-stem)
(defun proclaim-target-optimization ()
(let ((debug (if (position :sb-show *shebang-features*) 2 1)))
(sb-xc:proclaim
`(optimize
(compilation-speed 1) (debug ,debug)
;; CLISP's pretty-printer is fragile and tends to cause stack
;; corruption or fail internal assertions, as of 2003-04-20; we
;; therefore turn off as many notes as possible.
(sb!ext:inhibit-warnings #-clisp 2 #+clisp 3)
;; SAFETY = SPEED (and < 3) should provide reasonable safety,
;; but might skip some unreasonably expensive stuff
;; (e.g. %DETECT-STACK-EXHAUSTION in sbcl-0.7.2).
(safety 2) (space 1) (speed 2)
;; sbcl-internal optimization declarations:
;;
;; never insert stepper conditions
(sb!c:insert-step-conditions 0)
;; always stack-allocate if requested
(sb!c::stack-allocate-dynamic-extent 3)))))
(compile 'proclaim-target-optimization)
(defun in-target-cross-compilation-mode (fun)
"Call FUN with everything set up appropriately for cross-compiling
a target file."
(let (;; In order to increase microefficiency of the target Lisp,
;; enable old CMU CL defined-function-types-never-change
;; optimizations. (ANSI says users aren't supposed to
;; redefine our functions anyway; and developers can
;; fend for themselves.)
#!-sb-fluid
(sb!ext:*derive-function-types* t)
;; Let the target know that we're the cross-compiler.
(*features* (cons :sb-xc *features*))
;; We need to tweak the readtable..
(*readtable* (copy-readtable)))
;; ..in order to make backquotes expand into target code
;; instead of host code.
;; FIXME: Isn't this now taken care of automatically by
;; toplevel forms in the xcompiler backq.lisp file?
(set-macro-character #\` #'sb!impl::backquote-macro)
(set-macro-character #\, #'sb!impl::comma-macro)
;; Control optimization policy.
(proclaim-target-optimization)
;; Specify where target machinery lives.
(with-additional-nickname ("SB-XC" "SB!XC")
(funcall fun))))
(compile 'in-target-cross-compilation-mode)
(setf *target-compile-file* #'sb-xc:compile-file)
(setf *target-assemble-file* #'sb!c:assemble-file)
(setf *in-target-compilation-mode-fn* #'in-target-cross-compilation-mode)
;;; Run the cross-compiler to produce cold fasl files.
(load "src/cold/compile-cold-sbcl.lisp")
;;; miscellaneous tidying up and saving results
(let ((filename "output/object-filenames-for-genesis.lisp-expr"))
(ensure-directories-exist filename :verbose t)
(with-open-file (s filename :direction :output :if-exists :supersede)
(write *target-object-file-names* :stream s :readably t)))
;;; Let's check that the type system was reasonably sane. (It's easy
;;; to spend a long time wandering around confused trying to debug
;;; cold init if it wasn't.)
(when (position :sb-test *shebang-features*)
(load "tests/type.after-xc.lisp"))
;;; If you're experimenting with the system under a cross-compilation
;;; host which supports CMU-CL-style SAVE-LISP, this can be a good
;;; time to run it. The resulting core isn't used in the normal build,
;;; but can be handy for experimenting with the system. (See slam.sh
;;; for an example.)
(when (position :sb-after-xc-core *shebang-features*)
#+cmu (ext:save-lisp "output/after-xc.core" :load-init-file nil)
#+sbcl (sb-ext:save-lisp-and-die "output/after-xc.core")
#+openmcl (ccl::save-application "output/after-xc.core")
#+clisp (ext:saveinitmem "output/after-xc.core"))
#+cmu (ext:quit)
#+clisp (ext:quit)
#+abcl (ext:quit)
--- NEW FILE: make-target-2.lisp ---
;;; Now that we use the compiler for macros, interpreted /SHOW doesn't
;;; work until later in init.
#+sb-show (print "/hello, world!")
;;; Until PRINT-OBJECT and other machinery is set up, we want limits
;;; on printing to avoid infinite output. (Don't forget to undo these
;;; tweaks after the printer is set up. It'd be cleaner to use LET to
;;; make sure that happens automatically, but LET is implemented in
;;; terms of the compiler, and the compiler isn't initialized yet.)
(setq *print-length* 10)
(setq *print-level* 5)
(setq *print-circle* t)
;;; Do warm init.
#+sb-show (print "/about to LOAD warm.lisp")
(load "src/cold/warm.lisp")
;;; Unintern no-longer-needed stuff before the possible PURIFY in
;;; SAVE-LISP-AND-DIE.
#-sb-fluid (sb-impl::!unintern-init-only-stuff)
;;; Now that the whole system is built, we don't need to hobble the
;;; printer any more, so we can restore printer control variables to
;;; their ANSI defaults.
(setq *print-length* nil)
(setq *print-level* nil)
(setq *print-circle* nil)
(sb-int:/show "done with warm.lisp, about to GC :FULL T")
(gc :full t)
;;; resetting compilation policy to neutral values in preparation for
;;; SAVE-LISP-AND-DIE as final SBCL core (not in warm.lisp because
;;; SB-C::*POLICY* has file scope)
(sb-int:/show "setting compilation policy to neutral values")
(proclaim
'(optimize
(compilation-speed 1) (debug 1) (inhibit-warnings 1)
(safety 1) (space 1) (speed 1)))
;;; Lock internal packages
#+sb-package-locks
(dolist (p (list-all-packages))
(unless (member p (mapcar #'find-package '(:keyword :cl-user)))
(lock-package p)))
(sb-int:/show "done with warm.lisp, about to SAVE-LISP-AND-DIE")
;;; Even if /SHOW output was wanted during build, it's probably
;;; not wanted by default after build is complete. (And if it's
;;; wanted, it can easily be turned back on.)
#+sb-show (setf sb-int:*/show* nil)
;;; The system is complete now, all standard functions are
;;; defined.
(sb-kernel::ctype-of-cache-clear)
(setq sb-c::*flame-on-necessarily-undefined-function* t)
(sb-ext:save-lisp-and-die "output/sbcl.core")
Index: version.lisp-expr
===================================================================
RCS file: /cvsroot/sbcl/sbcl/version.lisp-expr,v
retrieving revision 1.2614
retrieving revision 1.2615
diff -u -d -r1.2614 -r1.2615
--- version.lisp-expr 28 Dec 2005 22:37:14 -0000 1.2614
+++ version.lisp-expr 29 Dec 2005 16:08:31 -0000 1.2615
@@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.8.3"
+"0.9.8.4"
Index: make-genesis-2.sh
===================================================================
RCS file: /cvsroot/sbcl/sbcl/make-genesis-2.sh,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- make-genesis-2.sh 16 Sep 2005 13:26:39 -0000 1.8
+++ make-genesis-2.sh 29 Dec 2005 16:08:31 -0000 1.9
@@ -30,31 +30,7 @@
# file at that time; but we needed to run it earlier in order to
# get to where we can write a .core file.)
echo //loading and running GENESIS to create cold-sbcl.core
-$SBCL_XC_HOST <<-'EOF'
- (setf *print-level* 5 *print-length* 5)
- (load "src/cold/shared.lisp")
- (in-package "SB-COLD")
- (setf *host-obj-prefix* "obj/from-host/"
- *target-obj-prefix* "obj/from-xc/")
- (load "src/cold/set-up-cold-packages.lisp")
- (load "src/cold/defun-load-or-cload-xcompiler.lisp")
- (load-or-cload-xcompiler #'host-load-stem)
- (defparameter *target-object-file-names*
- (with-open-file (s "output/object-filenames-for-genesis.lisp-expr"
- :direction :input)
- (read s)))
- (host-load-stem "src/compiler/generic/genesis")
- (sb!vm:genesis :object-file-names *target-object-file-names*
- :c-header-dir-name "output/genesis-2"
- :symbol-table-file-name "src/runtime/sbcl.nm"
- :core-file-name "output/cold-sbcl.core"
- ;; The map file is not needed by the system, but can
- ;; be very handy when debugging cold init problems.
- :map-file-name "output/cold-sbcl.map")
- #+cmu (ext:quit)
- #+clisp (ext:quit)
- #+abcl (ext:quit)
- EOF
+$SBCL_XC_HOST < make-genesis-2.lisp
echo //testing for consistency of first and second GENESIS passes
if diff -r src/runtime/genesis output/genesis-2; then
Index: make-host-1.sh
===================================================================
RCS file: /cvsroot/sbcl/sbcl/make-host-1.sh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- make-host-1.sh 16 Sep 2005 13:26:39 -0000 1.15
+++ make-host-1.sh 29 Dec 2005 16:08:31 -0000 1.16
@@ -28,33 +28,4 @@
# header file sbcl.h which will be needed to create the C runtime
# environment.
echo //building cross-compiler, and doing first genesis
-$SBCL_XC_HOST <<-'EOF' || exit 1
- ;; (We want to have some limit on print length and print level
- ;; during bootstrapping because PRINT-OBJECT only gets set
- ;; up rather late, and running without PRINT-OBJECT it's easy
- ;; to fall into printing enormous (or infinitely circular)
- ;; low-level representations of things.)
- (setf *print-level* 5 *print-length* 5)
- (load "src/cold/shared.lisp")
- (load "tools-for-build/ldso-stubs.lisp")
- (in-package "SB-COLD")
- (setf *host-obj-prefix* "obj/from-host/")
- (load "src/cold/set-up-cold-packages.lisp")
- (load "src/cold/defun-load-or-cload-xcompiler.lisp")
- (load-or-cload-xcompiler #'host-cload-stem)
- ;; Let's check that the type system is reasonably sane. (It's
- ;; easy to spend a long time wandering around confused trying
- ;; to debug cross-compilation if it isn't.)
- (when (find :sb-test *shebang-features*)
- (load "tests/type.before-xc.lisp")
- (load "tests/info.before-xc.lisp")
- (load "tests/vm.before-xc.lisp"))
- (load "tools-for-build/ucd.lisp")
- (sb-cold::slurp-ucd)
- (sb-cold::output)
- (host-cload-stem "src/compiler/generic/genesis")
- (sb!vm:genesis :c-header-dir-name "src/runtime/genesis")
- #+cmu (ext:quit)
- #+clisp (ext:quit)
- #+abcl (ext:quit)
- EOF
+$SBCL_XC_HOST < make-host-1.lisp || exit 1
Index: make-host-2.sh
===================================================================
RCS file: /cvsroot/sbcl/sbcl/make-host-2.sh,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- make-host-2.sh 16 Sep 2005 13:26:39 -0000 1.28
+++ make-host-2.sh 29 Dec 2005 16:08:31 -0000 1.29
@@ -45,101 +45,7 @@
# the fasl files into the new host Lisp, and that doesn't seem to be
# an enormously important disadvantage, either.)
echo //running cross-compiler to create target object files
-$SBCL_XC_HOST <<-'EOF'
-
- ;;;
- ;;; Set up the cross-compiler.
- ;;;
- (setf *print-level* 5 *print-length* 5)
- (load "src/cold/shared.lisp")
- (in-package "SB-COLD")
- (setf *host-obj-prefix* "obj/from-host/"
- *target-obj-prefix* "obj/from-xc/")
- (load "src/cold/set-up-cold-packages.lisp")
- (load "src/cold/defun-load-or-cload-xcompiler.lisp")
- (load-or-cload-xcompiler #'host-load-stem)
- (defun proclaim-target-optimization ()
- (let ((debug (if (position :sb-show *shebang-features*) 2 1)))
- (sb-xc:proclaim
- `(optimize
- (compilation-speed 1)
- (debug ,debug)
- ;; CLISP's pretty-printer is fragile and tends to cause
- ;; stack corruption or fail internal assertions, as of
- ;; 2003-04-20; we therefore turn off as many notes as
- ;; possible.
- (sb!ext:inhibit-warnings #-clisp 2
- #+clisp 3)
- ;; SAFETY = SPEED (and < 3) should provide reasonable
- ;; safety, but might skip some unreasonably expensive
- ;; stuff (e.g. %DETECT-STACK-EXHAUSTION in sbcl-0.7.2).
- (safety 2)
- (space 1)
- (speed 2)
- (sb!c:insert-step-conditions 0)
- (sb!c::stack-allocate-dynamic-extent 3)))))
- (compile 'proclaim-target-optimization)
- (defun in-target-cross-compilation-mode (fun)
- "Call FUN with everything set up appropriately for cross-compiling
- a target file."
- (let (;; In order to increase microefficiency of the target Lisp,
- ;; enable old CMU CL defined-function-types-never-change
- ;; optimizations. (ANSI says users aren't supposed to
- ;; redefine our functions anyway; and developers can
- ;; fend for themselves.)
- #!-sb-fluid (sb!ext:*derive-function-types* t)
- ;; Let the target know that we're the cross-compiler.
- (*features* (cons :sb-xc *features*))
- ;; We need to tweak the readtable..
- (*readtable* (copy-readtable)))
- ;; ..in order to make backquotes expand into target code
- ;; instead of host code.
- ;; FIXME: Isn't this now taken care of automatically by
- ;; toplevel forms in the xcompiler backq.lisp file?
- (set-macro-character #\` #'sb!impl::backquote-macro)
- (set-macro-character #\, #'sb!impl::comma-macro)
- ;; Control optimization policy.
- (proclaim-target-optimization)
- ;; Specify where target machinery lives.
- (with-additional-nickname ("SB-XC" "SB!XC")
- (funcall fun))))
- (compile 'in-target-cross-compilation-mode)
- (setf *target-compile-file* #'sb-xc:compile-file)
- (setf *target-assemble-file* #'sb!c:assemble-file)
- (setf *in-target-compilation-mode-fn*
- #'in-target-cross-compilation-mode)
-
- ;;;
- ;;; Run the cross-compiler to produce cold fasl files.
- ;;;
- (load "src/cold/compile-cold-sbcl.lisp")
-
- ;;;
- ;;; miscellaneous tidying up and saving results
- ;;;
- (let ((filename "output/object-filenames-for-genesis.lisp-expr"))
- (ensure-directories-exist filename :verbose t)
- (with-open-file (s filename :direction :output :if-exists :supersede)
- (write *target-object-file-names* :stream s :readably t)))
- ;; Let's check that the type system was reasonably sane. (It's
- ;; easy to spend a long time wandering around confused trying
- ;; to debug cold init if it wasn't.)
- (when (position :sb-test *shebang-features*)
- (load "tests/type.after-xc.lisp"))
- ;; If you're experimenting with the system under a
- ;; cross-compilation host which supports CMU-CL-style SAVE-LISP,
- ;; this can be a good time to run it. The resulting core isn't
- ;; used in the normal build, but can be handy for experimenting
- ;; with the system. (See slam.sh for an example.)
- (when (position :sb-after-xc-core *shebang-features*)
- #+cmu (ext:save-lisp "output/after-xc.core" :load-init-file nil)
- #+sbcl (sb-ext:save-lisp-and-die "output/after-xc.core")
- #+openmcl (ccl::save-application "output/after-xc.core")
- #+clisp (ext:saveinitmem "output/after-xc.core"))
- #+cmu (ext:quit)
- #+clisp (ext:quit)
- #+abcl (ext:quit)
- EOF
+$SBCL_XC_HOST < make-host-2.lisp
# Run GENESIS (again) in order to create cold-sbcl.core. (The first
# time was before we ran the cross-compiler, in order to create the
Index: make-target-2.sh
===================================================================
RCS file: /cvsroot/sbcl/sbcl/make-target-2.sh,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- make-target-2.sh 13 Oct 2005 00:01:36 -0000 1.26
+++ make-target-2.sh 29 Dec 2005 16:08:31 -0000 1.27
@@ -32,69 +32,4 @@
echo //doing warm init
./src/runtime/sbcl \
--core output/cold-sbcl.core \
---sysinit /dev/null --userinit /dev/null <<-'EOF'
- ;; Now that we use the compiler for macros, interpreted
- ;; /SHOW doesn't work until later in init.
- #+sb-show (print "/hello, world!")
-
- ;; Until PRINT-OBJECT and other machinery is set up,
- ;; we want limits on printing to avoid infinite output.
- ;; (Don't forget to undo these tweaks after the printer
- ;; is set up. It'd be cleaner to use LET to make sure
- ;; that happens automatically, but LET is implemented
- ;; in terms of the compiler, and the compiler isn't
- ;; initialized yet.)
- (setq *print-length* 10)
- (setq *print-level* 5)
- (setq *print-circle* t)
-
- ;; Do warm init.
- #+sb-show (print "/about to LOAD warm.lisp")
- (load "src/cold/warm.lisp")
-
- ;; Unintern no-longer-needed stuff before the possible PURIFY
- ;; in SAVE-LISP-AND-DIE.
- #-sb-fluid (sb-impl::!unintern-init-only-stuff)
-
- ;; Now that the whole system is built, we don't need to
- ;; hobble the printer any more, so we can restore printer
- ;; control variables to their ANSI defaults.
- (setq *print-length* nil)
- (setq *print-level* nil)
- (setq *print-circle* nil)
-
- ;; FIXME: Why is it that, at least on x86 sbcl-0.6.12.46,
- ;; GC :FULL T isn't nearly as effective as PURIFY here?
- ;; (GC :FULL T gets us down to about 38 Mbytes, but PURIFY
- ;; gets us down to about 19 Mbytes.)
- (sb-int:/show "done with warm.lisp, about to GC :FULL T")
- (gc :full t)
-
- ;; resetting compilation policy to neutral values in
- ;; preparation for SAVE-LISP-AND-DIE as final SBCL core (not
- ;; in warm.lisp because SB-C::*POLICY* has file scope)
- (sb-int:/show "setting compilation policy to neutral values")
- (proclaim '(optimize (compilation-speed 1)
- (debug 1)
- (inhibit-warnings 1)
- (safety 1)
- (space 1)
- (speed 1)))
-
- ;; Lock internal packages
- #+sb-package-locks
- (dolist (p (list-all-packages))
- (unless (member p (mapcar #'find-package '(:keyword :cl-user)))
- (lock-package p)))
-
- (sb-int:/show "done with warm.lisp, about to SAVE-LISP-AND-DIE")
- ;; Even if /SHOW output was wanted during build, it's probably
- ;; not wanted by default after build is complete. (And if it's
- ;; wanted, it can easily be turned back on.)
- #+sb-show (setf sb-int:*/show* nil)
- ;; The system is complete now, all standard functions are
- ;; defined.
- (sb-kernel::ctype-of-cache-clear)
- (setq sb-c::*flame-on-necessarily-undefined-function* t)
- (sb-ext:save-lisp-and-die "output/sbcl.core")
- EOF
+--sysinit /dev/null --userinit /dev/null < make-target-2.lisp
|