From dc16a69d4775d0494ccd0df8b49037057b7a36da Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 5 Mar 2017 11:10:48 -0700 Subject: [PATCH] Speed up SVM cross-build with new finish-cross-compilation:files. Undo 0ee3b64 . Delay compressing info files until after the .mocs are processed and a compiled runtime can be booted. --- src/Makefile.in | 9 +++++++-- src/compiler/base/crsend.scm | 24 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 0baf53dfd..0ae21ef9c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -750,9 +750,14 @@ cross-target: cross-host cross-end: cross-host (echo '(let ((env (->environment (quote (RUNTIME)))))' && \ echo ' (load "../compiler/base/crsend" env)' && \ - echo ' ((access FINISH-CROSS-COMPILATION:DIRECTORY env) ".."))') \ + echo ' ((access FINISH-CROSS-COMPILATION:FILES env) ".."))') \ | (cd runtime && ../microcode/scheme --batch-mode --library ../lib \ - --fasl make.bin) + --fasl make.bin) + (echo '(let ((env (->environment (quote (RUNTIME)))))' && \ + echo ' (load "../compiler/base/crsend" env)' && \ + echo ' ((access FINISH-CROSS-COMPILATION:INFO-FILES env) ".."))') \ + | (cd runtime && ../microcode/scheme --batch-mode --library ../lib \ + --fasl make.com) ### Stuff that depends on running the code we just compiled, because it ### uses Edwin macros. This is a kludge until we can fix macro phasing diff --git a/src/compiler/base/crsend.scm b/src/compiler/base/crsend.scm index 5dba929c9..934ad8db1 100644 --- a/src/compiler/base/crsend.scm +++ b/src/compiler/base/crsend.scm @@ -32,6 +32,8 @@ USA. ;;; compiler. (declare (usual-integrations)) + +(load-option 'COMPRESS) ; XXX ugh (define (finish-cross-compilation:directory directory #!optional force?) (let ((force? (if (default-object? force?) #f force?))) @@ -52,6 +54,21 @@ USA. (finish-cross-compilation:file pathname force?)))) (directory-read (pathname-as-directory directory)))))) +(define (finish-cross-compilation:files directory #!optional force?) + (let ((force? (if (default-object? force?) #f force?))) + (let loop ((directory directory)) + (for-each (lambda (pathname) + (cond ((file-directory? pathname) + (if (not (let ((ns (file-namestring pathname))) + (or (string=? ns ".") + (string=? ns "..")))) + (loop pathname))) + ((let ((t (pathname-type pathname))) + (and (string? t) + (string=? t "moc"))) + (finish-cross-compilation:file pathname force?)))) + (directory-read (pathname-as-directory directory)))))) + (define (finish-cross-compilation:info-files directory #!optional force?) (let ((force? (if (default-object? force?) #f force?))) (let loop ((directory directory)) @@ -219,9 +236,4 @@ USA. (sc-macro-transformer (lambda (form environment) environment - (apply microcode-type (cdr form))))) - -;;(load-option 'COMPRESS) ; XXX ugh -;; The interpreted compress is terribly slow. -(finish-cross-compilation:file "cpress.moc") -(load "cpress.com" (->environment '(runtime compress))) \ No newline at end of file + (apply microcode-type (cdr form))))) \ No newline at end of file -- 2.25.1