cs: fix copied environment setup from cross-compilation

The copy of the environment setup for cross-compilation was
out of sync with the main environment configuration.
This commit is contained in:
Matthew Flatt 2019-07-23 19:21:46 -06:00
parent 8b916fc5c1
commit f63ededab8
6 changed files with 30 additions and 38 deletions

View File

@ -105,7 +105,7 @@ rktl:
mkdir -p ../../bin
touch ../../bin/racket
$(BUILDDIR)expander.$(CSO): expander.sls $(BUILDDIR)compiled/expander.scm $(PRIMITIVES_TABLES) $(EXPANDER_DEPS) $(COMPILE_FILE_DEPS)
$(BUILDDIR)expander.$(CSO): expander.sls expander/env.ss $(BUILDDIR)compiled/expander.scm $(PRIMITIVES_TABLES) $(EXPANDER_DEPS) $(COMPILE_FILE_DEPS)
$(COMPILE_FILE) expander.sls $(EXPANDER_DEPS)
$(BUILDDIR)compiled/expander.scm: $(BUILDDIR)compiled/expander.rktl $(CONVERT_DEPS)

View File

@ -341,8 +341,8 @@ plain-install-upcased:
SCHEME_XPATCH = $(SCHEME_SRC)/$(TARGET_MACH)/s/xpatch
compile-xpatch.$(TARGET_MACH): $(SCHEME_XPATCH) $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss
$(SCHEME) --script $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss
compile-xpatch.$(TARGET_MACH): $(SCHEME_XPATCH) $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss $(srcdir)/../expander/env.ss
$(SCHEME) --script $(srcdir)/mk-cross-serve.ss $(srcdir)/cross-serve.ss $(srcdir)/../expander/env.ss
cat cross-serve.so $(SCHEME_XPATCH) > compile-xpatch.$(TARGET_MACH)
RACKET_XPATCH = chezpart.$(MACH) rumble.$(MACH) thread.$(MACH) \

View File

@ -20,23 +20,10 @@
(enable-arithmetic-left-associative #t)
(generate-procedure-source-information #t)
(expand-omit-library-invocations #t)
;; Set up the environment
(expand `(import (rename (rumble)
[correlated? syntax?]
[correlated-source syntax-source]
[correlated-line syntax-line]
[correlated-column syntax-column]
[correlated-position syntax-position]
[correlated-span syntax-span]
[correlated-e syntax-e]
[correlated->datum syntax->datum]
[datum->correlated datum->syntax]
[correlated-property syntax-property]
[correlated-property-symbol-keys syntax-property-symbol-keys])
(thread)
(io)
(regexp)
(linklet)))
;; Set up the environment; ../expander/env.ss must be loaded before compiling
(expand (let-syntax ([env (lambda (stx)
(datum->syntax stx (list 'quote environment-imports)))])
env))
;; Serve requests to compile or to fasl data:
(let ([in (standard-input-port)]
[out (standard-output-port)])

View File

@ -1,2 +1,3 @@
(let ([args (command-line-arguments)])
(load (cadr args))
(compile-file (car args) "cross-serve.so"))

View File

@ -87,27 +87,12 @@
;; ----------------------------------------
(include "expander/env.ss")
;; The environment is used to evaluate linklets, so all primitives
;; need to be there imported there
(parameterize ([expand-omit-library-invocations #f])
(eval `(import (rename (rumble)
[correlated? syntax?]
[correlated-source syntax-source]
[correlated-line syntax-line]
[correlated-column syntax-column]
[correlated-position syntax-position]
[correlated-span syntax-span]
[correlated-e syntax-e]
[correlated->datum syntax->datum]
[datum->correlated datum->syntax]
[correlated-property syntax-property]
[correlated-property-symbol-keys syntax-property-symbol-keys])
(thread)
(io)
(regexp)
(linklet)
(only (schemify)
force-unfasl)))
(eval environment-imports) ; defined in "expander/env.ss"
;; Ensure that the library is visited, especially for a wpo build:
(eval 'variable-set!))

View File

@ -0,0 +1,19 @@
(define environment-imports
`(import (rename (rumble)
[correlated? syntax?]
[correlated-source syntax-source]
[correlated-line syntax-line]
[correlated-column syntax-column]
[correlated-position syntax-position]
[correlated-span syntax-span]
[correlated-e syntax-e]
[correlated->datum syntax->datum]
[datum->correlated datum->syntax]
[correlated-property syntax-property]
[correlated-property-symbol-keys syntax-property-symbol-keys])
(thread)
(io)
(regexp)
(linklet)
(only (schemify)
force-unfasl)))