diff options
author | Christophe Rhodes <csr21@cam.ac.uk> | 2005-12-29 16:08:31 +0000 |
---|---|---|
committer | Christophe Rhodes <csr21@cam.ac.uk> | 2005-12-29 16:08:31 +0000 |
commit | 89987c8a1599b9bfc267d8d54ea02c588e8b24a5 (patch) | |
tree | cb118f1665616dd4feba5ef1b496383c5e72eec3 | |
parent | 3ceaa081c90a970f6779e02bed659835a202772c (diff) |
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)
-rw-r--r-- | make-genesis-2.lisp | 23 | ||||
-rw-r--r-- | make-genesis-2.sh | 26 | ||||
-rw-r--r-- | make-host-1.lisp | 35 | ||||
-rw-r--r-- | make-host-1.sh | 31 | ||||
-rw-r--r-- | make-host-2.lisp | 94 | ||||
-rw-r--r-- | make-host-2.sh | 96 | ||||
-rw-r--r-- | make-target-2.lisp | 56 | ||||
-rw-r--r-- | make-target-2.sh | 67 | ||||
-rw-r--r-- | version.lisp-expr | 2 |
9 files changed, 213 insertions, 217 deletions
diff --git a/make-genesis-2.lisp b/make-genesis-2.lisp new file mode 100644 index 000000000..9bc9e21c6 --- /dev/null +++ b/make-genesis-2.lisp @@ -0,0 +1,23 @@ +(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) diff --git a/make-genesis-2.sh b/make-genesis-2.sh index 908ce95c0..b76040690 100644 --- a/make-genesis-2.sh +++ b/make-genesis-2.sh @@ -30,31 +30,7 @@ echo //entering make-genesis-2.sh # 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 diff --git a/make-host-1.lisp b/make-host-1.lisp new file mode 100644 index 000000000..0a22dfe2f --- /dev/null +++ b/make-host-1.lisp @@ -0,0 +1,35 @@ +;;; (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) diff --git a/make-host-1.sh b/make-host-1.sh index 3719026e4..3bd8d74c2 100644 --- a/make-host-1.sh +++ b/make-host-1.sh @@ -28,33 +28,4 @@ export LANG LC_ALL # 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 diff --git a/make-host-2.lisp b/make-host-2.lisp new file mode 100644 index 000000000..8bc96bf36 --- /dev/null +++ b/make-host-2.lisp @@ -0,0 +1,94 @@ +;;; 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) diff --git a/make-host-2.sh b/make-host-2.sh index 0321ad33d..347400e46 100644 --- a/make-host-2.sh +++ b/make-host-2.sh @@ -45,101 +45,7 @@ rm -f output/after-xc.core # 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 diff --git a/make-target-2.lisp b/make-target-2.lisp new file mode 100644 index 000000000..9a82e3701 --- /dev/null +++ b/make-target-2.lisp @@ -0,0 +1,56 @@ +;;; 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") diff --git a/make-target-2.sh b/make-target-2.sh index 783d442f7..998bffefd 100644 --- a/make-target-2.sh +++ b/make-target-2.sh @@ -32,69 +32,4 @@ export LANG LC_ALL 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 diff --git a/version.lisp-expr b/version.lisp-expr index 4cb1442e7..59e22d68d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" |