1.0.43.10: make.sh now accepts --dynamic-space-size=<size> option
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 30 Sep 2010 08:36:38 +0000 (08:36 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 30 Sep 2010 08:36:38 +0000 (08:36 +0000)
 ...so users can build SBCL with the right default without
 touching source.

 Fixes lp#383222.

INSTALL
NEWS
make.sh
src/compiler/generic/parms.lisp
src/compiler/ppc/parms.lisp
src/compiler/x86-64/parms.lisp
src/compiler/x86/parms.lisp
version.lisp-expr

diff --git a/INSTALL b/INSTALL
index f840516..b1413ab 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -126,6 +126,15 @@ INSTALLING SBCL
   This also sets the default SBCL_HOME to prefix/lib/sbcl/ for the
   built binaries.
 
+  To configure SBCL with a non-standard default dynamic-space size,
+  use the --dynamic-space-size option:
+
+    $ sh make.sh --dynamic-space-size=1Gb
+    $ sh make.sh --dynamic-space-size=500Mb
+
+  If mega- or gigabytes are not specified, the number is taken to be
+  in megabytes. The standard default is platform specific.
+
   If you don't already have an SBCL binary installed as "sbcl" on your
   system, you'll need to tell make.sh what Lisp to use as the
   cross-compilation host. For example, to use CMUCL (assuming has
diff --git a/NEWS b/NEWS
index c5427fa..f4edd25 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ changes relative to sbcl-1.0.43:
     external-format for its :INPUT, :OUTPUT, AND :ERROR :STREAMs.
   * enhancement: ALLOCATION-INFORMATION also provides the page the object
     resides on.
+  * enhancement: default dynamic-space size can be configured at build-time
+    without touching source, using the --dynamic-space-size argument to make.sh.
   * bug fix: compiler failed to derive the result-type of MAKE-ARRAY as
     (AND VECTOR (NOT SIMPLE-ARRAY)) when appropriate. (lp#309130)
   * bug fix: (THE (VALUES ...)) in LOAD-TIME-VALUE caused a compiler-error.
diff --git a/make.sh b/make.sh
index 30a91a8..6dafe9f 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -71,6 +71,9 @@ do
       --xc-host=)
         $optarg_ok && SBCL_XC_HOST=$optarg
         ;;
+      --dynamic-space-size=)
+        $optarg_ok && SBCL_DYNAMIC_SPACE_SIZE=$optarg
+       ;;
       -*)
         bad_option "Unknown command-line option to $0: \"$option\""
         ;;
@@ -118,6 +121,12 @@ Options:
 
       Default prefix is: /usr/local
 
+  --dynamic-space-size=<size> Specify default dynamic-space size.
+
+      If not provided, the default is platform-specific. <size> is
+      taken to be megabytes unless explicitly suffixed with Gb in
+      order to specify the size in gigabytes.
+
   --xc-host=<string>   Specify the Common Lisp compilation host.
 
       The string provided should be a command to invoke the
@@ -155,9 +164,10 @@ echo "//Starting build: $build_started"
 # Apparently option parsing succeeded. Print out the results.
 echo "//Options: --prefix='$SBCL_PREFIX' --xc-host='$SBCL_XC_HOST'"
 
-# Save prefix for make and install.sh.
 mkdir -p output
+# Save prefix for make and install.sh.
 echo "SBCL_PREFIX='$SBCL_PREFIX'" > output/prefix.def
+echo "$SBCL_DYNAMIC_SPACE_SIZE" > output/dynamic-space-size.txt
 
 # FIXME: Tweak this script, and the rest of the system, to support
 # a second bootstrapping pass in which the cross-compilation host is
index d590aeb..dfdcaa5 100644 (file)
 
 (in-package "SB!VM")
 
+(def!macro !configure-dynamic-space-end (default)
+  (with-open-file (f "output/dynamic-space-size.txt")
+    (let ((line (read-line f)))
+      (multiple-value-bind (number end)
+          (parse-integer line :junk-allowed t)
+        (if number
+            (let* ((ext (subseq line end))
+                   (mult (cond ((or (zerop (length ext))
+                                    (member ext '("MB MIB") :test #'equalp))
+                                (expt 2 20))
+                               ((member ext '("GB" "GIB") :test #'equalp)
+                                (expt 2 30))
+                               (t
+                                (error "Invalid --dynamic-space-size=~A" line)))))
+              `(+ dynamic-space-start ,(* number mult)))
+            default)))))
+
 (defparameter *c-callable-static-symbols*
   '(sub-gc
     sb!kernel::post-gc
index f03c325..363556b 100644 (file)
   #!+gencgc
   (progn
     (def!constant dynamic-space-start #x4f000000)
-    (def!constant dynamic-space-end   #x7efff000))
+    (def!constant dynamic-space-end   (!configure-dynamic-space-end #x7efff000)))
   #!-gencgc
   (progn
     (def!constant dynamic-0-space-start #x4f000000)
   #!+gencgc
   (progn
     (def!constant dynamic-space-start #x4f000000)
-    (def!constant dynamic-space-end   #x7efff000))
+    (def!constant dynamic-space-end   (!configure-dynamic-space-end #x7efff000)))
   #!-gencgc
   (progn
     (def!constant dynamic-0-space-start #x4f000000)
   #!+gencgc
   (progn
     (def!constant dynamic-space-start #x4f000000)
-    (def!constant dynamic-space-end   #x6afff000))
+    (def!constant dynamic-space-end   (!configure-dynamic-space-end #x6afff000)))
   #!-gencgc
   (progn
     (def!constant dynamic-0-space-start #x4f000000)
   #!+gencgc
   (progn
     (def!constant dynamic-space-start #x10000000)
-    (def!constant dynamic-space-end   #x6ffff000))
+    (def!constant dynamic-space-end   (!configure-dynamic-space-end #x6ffff000)))
   #!-gencgc
   (progn
     (def!constant dynamic-0-space-start #x10000000)
index 7d03224..4d4cebb 100644 (file)
   (def!constant static-space-start        #x20100000)
   (def!constant static-space-end          #x201ff000)
 
-  (def!constant dynamic-space-start   #x1000000000)
+  (def!constant dynamic-space-start       #x1000000000)
   #!-openbsd
-  (def!constant dynamic-space-end     #x11ffff0000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #x11ffff0000))
   #!+openbsd
   ;; This is lower on OpenBSD to allow SBCL to run under the default
   ;; 512M data size limit.
-  (def!constant dynamic-space-end     #x101bcf0000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #x101bcf0000))
 
   (def!constant linkage-table-space-start #x20200000)
   (def!constant linkage-table-space-end   #x202ff000)
index 44b5050..8bf3674 100644 (file)
   (def!constant static-space-end      #x221ff000)
 
   (def!constant dynamic-space-start   #x22300000)
-  (def!constant dynamic-space-end     #x42300000)
+  (def!constant dynamic-space-end     (!configure-dynamic-space-end #x42300000))
 
   (def!constant linkage-table-space-start #x22200000)
   (def!constant linkage-table-space-end   #x222ff000))
   (def!constant static-space-end          #x011ff000)
 
   (def!constant dynamic-space-start       #x09000000)
-  (def!constant dynamic-space-end         #x29000000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #x29000000))
 
   (def!constant linkage-table-space-start #x01200000)
   (def!constant linkage-table-space-end   #x012ff000))
   (def!constant static-space-end          #x201ff000)
 
   (def!constant dynamic-space-start       #x48000000)
-  (def!constant dynamic-space-end         #xA0000000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #xA0000000))
 
   (def!constant linkage-table-space-start #x20200000)
   (def!constant linkage-table-space-end   #x202ff000))
   (def!constant static-space-end          #x011ff000)
 
   (def!constant dynamic-space-start       #x58000000)
-  (def!constant dynamic-space-end         #x98000000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #x98000000))
 
   (def!constant linkage-table-space-start #x01200000)
   (def!constant linkage-table-space-end   #x012ff000))
   (def!constant static-space-end          #x1b1ff000)
 
   (def!constant dynamic-space-start       #x40000000)
-  (def!constant dynamic-space-end         #x5bfff000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #x5bfff000))
 
   (def!constant linkage-table-space-start #x1b200000)
   (def!constant linkage-table-space-end   #x1b2ff000))
   (def!constant static-space-end          #x201ff000)
 
   (def!constant dynamic-space-start       #x60000000)
-  (def!constant dynamic-space-end         #x98000000)
+  (def!constant dynamic-space-end         (!configure-dynamic-space-end #x98000000))
 
   ;; In CMUCL: 0xB0000000->0xB1000000
   (def!constant linkage-table-space-start #x20200000)
   (def!constant static-space-end      #x041ff000)
 
   (def!constant dynamic-space-start #x10000000)
-  (def!constant dynamic-space-end   #x6ffff000)
+  (def!constant dynamic-space-end   (!configure-dynamic-space-end #x6ffff000))
 
   (def!constant linkage-table-space-start #x04200000)
   (def!constant linkage-table-space-end   #x042ff000))
index 90b5600..20b341a 100644 (file)
@@ -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".)
-"1.0.43.9"
+"1.0.43.10"