Revert 13b5bca. Use the host's runtime, not a cross runtime.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Tue, 15 Oct 2013 17:19:42 +0000 (10:19 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Tue, 15 Oct 2013 17:19:42 +0000 (10:19 -0700)
Revert 41c0070 and 5cf6bfc too, and the "training" in cref/make.scm
(for the compiler) and runtime.sf (for a cross runtime).

src/Makefile.tools.in
src/compiler/Stage.sh
src/etc/Stage.sh
src/etc/compile-boot-compiler.sh
src/etc/compile-svm.sh
src/runtime/runtime.sf
src/runtime/utabs.scm

index bb787b2c8ef1162de96d6f4a80e85379dc09d993..7b3a50700d747e73776c679b8849de6b0cf8570b 100644 (file)
@@ -1,4 +1,3 @@
-# -*-makefile-*-
 # Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
 #     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 #     2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
@@ -63,9 +62,13 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/microcode/mkinstalldirs
 
 MIT_SCHEME_EXE = @MIT_SCHEME_EXE@
 
-HOST_COMPILER = $(MIT_SCHEME_EXE) --batch-mode
-CROSS_SYNTAXER = '$(MIT_SCHEME_EXE)' --batch-mode --band ./tools/syntaxer.com
-HOST_SYNTAXER = '$(MIT_SCHEME_EXE)' --batch-mode
+HOST_COMPILER = $(HOST_TOOLCHAIN)
+HOST_RUNTIME = '$(MIT_SCHEME_EXE)' --batch-mode --band runtime.com
+HOST_SYNTAXER = '$(MIT_SCHEME_EXE)' --batch-mode --band runtime.com \
+       --eval '(load-option (quote CREF))' \
+       --eval '(load-option (quote SF))'
+HOST_TOOLCHAIN = '$(MIT_SCHEME_EXE)' --batch-mode \
+       --eval '(load-option (quote CREF))'
 
 SUBDIRS = compiler cref runtime sf star-parser
 
@@ -117,25 +120,33 @@ restore:
 
 tools/compiler.com: tools/syntaxer.com
 tools/compiler.com: compile-cross-compiler
+tools/compiler.com: compile-cross-cref
+tools/compiler.com: compile-cross-sf
+tools/compiler.com: compile-kludgerous-star-parser
        (echo '(begin' && \
+        echo '  (with-working-directory-pathname "cref"' && \
+        echo '    (lambda () (load "make")))' && \
+        echo '  (with-working-directory-pathname "sf"' && \
+        echo '    (lambda () (load "make")))' && \
+        echo '  (with-working-directory-pathname "star-parser"' && \
+        echo '    (lambda () (load "load")))' && \
         echo '  (with-working-directory-pathname "compiler"' && \
         echo '    (lambda () (load "make")))' && \
         echo '  (disk-save "$@"))') \
-       | $(CROSS_SYNTAXER)
+       | $(HOST_RUNTIME)
 
-tools/syntaxer.com: compile-cross-runtime
 tools/syntaxer.com: compile-cross-cref
 tools/syntaxer.com: compile-cross-sf
-tools/syntaxer.com: compile-cross-star-parser
+tools/syntaxer.com: compile-kludgerous-star-parser
        (echo '(begin' && \
-        echo '  (with-working-directory-pathname "../cref"' && \
+        echo '  (with-working-directory-pathname "cref"' && \
         echo '    (lambda () (load "make")))' && \
-        echo '  (with-working-directory-pathname "../sf"' && \
+        echo '  (with-working-directory-pathname "sf"' && \
         echo '    (lambda () (load "make")))' && \
-        echo '  (with-working-directory-pathname "../star-parser"' && \
+        echo '  (with-working-directory-pathname "star-parser"' && \
         echo '    (lambda () (load "load")))' && \
-        echo '  (disk-save "../$@"))') \
-       | (cd runtime && '$(MIT_SCHEME_EXE)' --batch-mode --fasl make.com)
+        echo '  (disk-save "$@"))') \
+       | $(HOST_RUNTIME)
 
 # Compiler (LIAR)
 
@@ -180,29 +191,28 @@ compile-cross-compiler-rtlgen: syntax-cross-compiler
 compile-cross-compiler-rtlopt: syntax-cross-compiler
        echo '(compile-directory "compiler/rtlopt")' | $(HOST_COMPILER)
 
+# Must use HOST_SYNTAXER here because compiler.sf's (and, more
+# generally, CREF's) host/target distinction is bollocksed up, and will
+# do the wrong thing if there is already a compiler loaded into the
+# image.
 .PHONY: syntax-cross-compiler
-syntax-cross-compiler: tools/syntaxer.com
 @IF_SVM@syntax-cross-compiler: compiler/machines/svm/assembler-db.scm
+syntax-cross-compiler: cref-cross-compiler
        (echo '(with-working-directory-pathname "compiler"' && \
         echo '  (lambda () (load "compiler.sf")))') \
-       | $(CROSS_SYNTAXER)
+       | $(HOST_SYNTAXER)
 
 compiler/machines/svm/assembler-db.scm:
        (cd compiler/machines/svm && \
         '$(MIT_SCHEME_EXE)' --batch-mode --load compile-assembler </dev/null)
 
-# RUNTIME
-
-.PHONY: compile-cross-runtime
-compile-cross-runtime: syntax-cross-runtime
-       (echo '(with-working-directory-pathname "runtime"' && \
-        echo '  (lambda () (load "runtime.cbf")))') \
-       | $(HOST_COMPILER)
-
-.PHONY: syntax-cross-runtime
-syntax-cross-runtime:
-       (echo '(with-working-directory-pathname "runtime"' && \
-        echo '  (lambda () (load "runtime.sf")))') \
+.PHONY: cref-cross-compiler
+cref-cross-compiler: cref-cross-cref
+cref-cross-compiler: cref-cross-sf
+cref-cross-compiler: cref-kludgerous-runtime
+       (echo '(with-working-directory-pathname "compiler"' && \
+        echo '  (lambda ()' && \
+        echo '    (cref/generate-trivial-constructor "compiler")))') \
        | $(HOST_SYNTAXER)
 
 # CREF
@@ -214,11 +224,18 @@ compile-cross-cref: syntax-cross-cref
        | $(HOST_COMPILER)
 
 .PHONY: syntax-cross-cref
-syntax-cross-cref: compile-cross-runtime # for runtime.pkd
+syntax-cross-cref: cref-cross-cref
        (echo '(with-working-directory-pathname "cref"' && \
         echo '  (lambda () (load "cref.sf")))') \
        | $(HOST_SYNTAXER)
 
+.PHONY: cref-cross-cref
+cref-cross-cref: cref-kludgerous-runtime
+       (echo '(with-working-directory-pathname "cref"' && \
+        echo '  (lambda ()' && \
+        echo '    (cref/generate-trivial-constructor "cref")))') \
+       | $(HOST_SYNTAXER)
+
 # SF
 
 .PHONY: compile-cross-sf
@@ -228,15 +245,38 @@ compile-cross-sf: syntax-cross-sf
        | $(HOST_COMPILER)
 
 .PHONY: syntax-cross-sf
-syntax-cross-sf: compile-cross-runtime # for runtime.pkd
+syntax-cross-sf: cref-cross-sf
        (echo '(with-working-directory-pathname "sf"' && \
         echo '  (lambda () (load "sf.sf")))') \
        | $(HOST_SYNTAXER)
 
-# *PARSER
+.PHONY: cref-cross-sf
+cref-cross-sf: cref-kludgerous-runtime
+       (echo '(with-working-directory-pathname "sf"' && \
+        echo '  (lambda ()' && \
+        echo '    (cref/generate-trivial-constructor "sf")))') \
+       | $(HOST_SYNTAXER)
+
+# Kludges
 
-.PHONY: compile-cross-star-parser
-compile-cross-star-parser: compile-cross-runtime # for runtime.pkd
+# XXX This is a kludge that should be abolished.  The compiler should
+# be able to load and run macros for the target even if we are cross-
+# compiling, but currently that's not doable.
+.PHONY: compile-kludgerous-star-parser
+compile-kludgerous-star-parser: cref-kludgerous-runtime
        (echo '(with-working-directory-pathname "star-parser"' && \
-        echo '  (lambda () (load "compile.scm")))') \
-       | $(HOST_COMPILER)
+        echo '  (lambda () (load "compile")))') \
+       | $(HOST_TOOLCHAIN)
+
+# XXX This is a mega-kludge that should be abolished.  Parser.pkg has
+# (global-definitions "../../runtime"), which should refer to the
+# host's runtime packaging -- but that doesn't get installed anywhere!
+# So instead we pretend it refers to the target's runtime packaging
+# (which may be completely wrong for something we want to load into the
+# host).
+.PHONY: cref-kludgerous-runtime
+cref-kludgerous-runtime:
+       (echo '(with-working-directory-pathname "runtime"' && \
+        echo '  (lambda ()' && \
+        echo '    (cref/generate-trivial-constructor "runtime")))') \
+       | $(HOST_TOOLCHAIN)
index 85bfbbd81ed01837c751eca70245c86ff84e65e4..889e2fed2a90984b40ed79cd7e607b0a0e61f2bd 100755 (executable)
@@ -52,23 +52,7 @@ make-cross)
          maybe_mv *.com "$S"
          maybe_mv *.bci "$S"
          maybe_mv *.moc "$S"
-         maybe_mv *.fni "$S"
-         maybe_mv *.lap "$S"
-         maybe_mv *.rtl "$S" )
-    done
-    ;;
-make-clean)
-    for D in $SUBDIRS; do
-       ( cd $D
-         mkdir "$S"
-         maybe_mv *.bin "$S"
-         maybe_mv *.ext "$S"
-         maybe_mv *.com "$S"
-         maybe_mv *.bci "$S"
-         maybe_mv *.moc "$S"
-         maybe_mv *.fni "$S"
-         maybe_mv *.lap "$S"
-         maybe_mv *.rtl "$S" )
+         maybe_mv *.fni "$S" )
     done
     ;;
 unmake)
index 3692d94110989828ffb3cbe46e396fafd1e44f35..b5c9bf602b5942a0e750dfc5d2396b0c2c4db8e2 100755 (executable)
@@ -52,17 +52,6 @@ make-cross)
     maybe_mv *.lap "${DIRNAME}/."
     maybe_mv *.rtl "${DIRNAME}/."
     ;;
-make-clean)
-    mkdir "${DIRNAME}"
-    maybe_mv *.bin "${DIRNAME}/."
-    maybe_mv *.ext "${DIRNAME}/."
-    maybe_mv *.com "${DIRNAME}/."
-    maybe_mv *.bci "${DIRNAME}/."
-    maybe_mv *.moc "${DIRNAME}/."
-    maybe_mv *.fni "${DIRNAME}/."
-    maybe_mv *.lap "${DIRNAME}/."
-    maybe_mv *.rtl "${DIRNAME}/."
-    ;;
 unmake)
     if [ -d "${DIRNAME}" ]; then
        maybe_mv "${DIRNAME}"/* .
index e8312cd00eef6f739a3a5008631531799c28fad3..ae4f300bc63e7235ddcdb3570b310ee6997cbba8 100755 (executable)
@@ -70,5 +70,5 @@ run_cmd "${EXE}" --batch-mode --library lib --band x-runtime.com <<EOF
   (disk-save "lib/x-compiler.com"))
 EOF
 
-# Remove host (native) code (.bins as well as .coms) to STAGEX/ subdirs.
-run_cmd ./Stage.sh make-clean X
+# Remove host (native) code to STAGEX/ subdirs.
+run_cmd ./Stage.sh make X
index c6e43009bbceb0bd13f570b7b9d3e06355894878..8929ba27032f508c97be3837fdda6b63dc521b20 100755 (executable)
@@ -63,7 +63,9 @@ echo ""
 echo "# `date`:    Re-syntax cross-compiler using x-runtime.com."
 run_cmd_in_dir compiler \
     "${@}" --batch-mode --library ../lib --band x-runtime.com <<EOF
-(load "compiler.sf")
+(begin
+  (load "compiler.sf")
+  (sf "base/crsend"))
 EOF
 
 if [ -s compiler/compiler-unx.crf ]; then
@@ -85,7 +87,7 @@ run_cmd "${@}" --batch-mode --library lib --band x-runtime.com <<EOF
 EOF
 
 echo "# `date`: Remove host code to STAGEX/ subdirs."
-run_cmd ./Stage.sh make-clean X
+run_cmd ./Stage.sh make X
 
 echo "# `date`: Restore previously cross-compiled code."
 # (Replace "unmake" with "remove" to start from scratch with each
@@ -112,8 +114,7 @@ if [ "${FAST}" ]; then
   (fluid-let ((compiler:generate-lap-files? #t)
              (compiler:intersperse-rtl-in-lap? #t)
              (compiler:cross-compiling? #t))
-    (compile-everything))
-  (sf "compiler/base/crsend"))
+    (compile-everything)))
 EOF
 
     echo "# `date`: Finish-cross-compilation of everything."
@@ -146,8 +147,7 @@ run_cmd "${@}" --batch-mode --library lib \
   (fluid-let ((compiler:generate-lap-files? #f)
              (compiler:intersperse-rtl-in-lap? #f)
              (compiler:cross-compiling? #t))
-    (compile-boot-dirs compile-dir))
-  (sf "compiler/base/crsend"))
+    (compile-boot-dirs compile-dir)))
 EOF
 
 echo "# `date`: Finish-cross-compilation of boot-dirs."
@@ -170,7 +170,7 @@ run_cmd_in_dir runtime \
   (disk-save "../lib/boot-compiler.com"))
 EOF
 
-run_cmd ./Stage.sh make-clean 0
+run_cmd ./Stage.sh make-cross 0
 
 echo "# `date`: Use the new machine and compiler to re-compile everything."
 run_cmd ./microcode/scheme --batch-mode --library lib \
index a5dd1c35920fd28badc927064af58b412e092615..07572f5ace1b733ca2d515b35374cb991a6668a4 100644 (file)
@@ -24,14 +24,6 @@ USA.
 
 |#
 
-;; Temporarily: ensure host knows new type code SEQUENCE.  Older hosts
-;; have an equivalent SEQUENCE-2 and type-aliases.
-(if (not (microcode-type/name->code 'sequence))
-    (let ((env (->environment '(runtime microcode-tables))))
-      (set! (access type-aliases env)
-           (cons '(sequence-2 sequence)
-                 (access type-aliases env)))))
-
 (load-option '*PARSER)                 ;for url.scm
 (fluid-let ((sf/default-syntax-table (->environment '(RUNTIME))))
   (sf-conditionally "char")
index 8dd0737ef9db8306a05a8117930193e1b36add21..002b261c4e35c6cde01e82e57285ba26cc62ccfb 100644 (file)
@@ -68,17 +68,6 @@ USA.
        (microcode-identification-item 'CONSOLE-WIDTH))
   (set! microcode-id/tty-y-size
        (microcode-identification-item 'CONSOLE-HEIGHT))
-
-  ;; Temporarily: ensure host knows new type code SEQUENCE.  Older hosts
-  ;; have an equivalent SEQUENCE-2 and type-aliases.
-  (if (not (microcode-type/name->code 'sequence))
-      (set! type-aliases
-           (cons '(SEQUENCE-2 SEQUENCE)
-                 type-aliases)))
-  (if (not (microcode-return/name->code 'sequence-continue))
-      (set! returns-aliases
-           (cons '(SEQUENCE-2-SECOND SEQUENCE-CONTINUE)
-                 returns-aliases)))
   unspecific)
 
 (define (intern string)