diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-12-22 16:57:54 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-08-07 11:35:34 +0200 |
commit | c91e9e9220aca3d1d3245a742fcadf3e0d8f472c (patch) | |
tree | 283ec2124204624eb7c8a09462fdf25c3002b492 /module/scripts/compile.scm | |
parent | c5e1d6eaf4a1fa5cc6dfe18e3067f927061aeb6b (diff) | |
download | guile-c91e9e9220aca3d1d3245a742fcadf3e0d8f472c.tar.gz |
compile: Load language modules upfront.
Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
--from=elisp ... language/elisp/boot.el" would fail with an exception
from 'load-thunk-from-memory' while trying to load (language elisp spec)
from the guile-being-compiled instead of using that of the
guile-for-build.
The problem did not manifest with --from=scheme because (language scheme
spec) happened to be already loaded before we had changed %load-path.
* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.
Diffstat (limited to 'module/scripts/compile.scm')
-rw-r--r-- | module/scripts/compile.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/module/scripts/compile.scm b/module/scripts/compile.scm index 26c79f1ee..5aa58d3e9 100644 --- a/module/scripts/compile.scm +++ b/module/scripts/compile.scm @@ -1,6 +1,6 @@ ;;; Compile --- Command-line Guile Scheme compiler -*- coding: iso-8859-1 -*- -;; Copyright 2005, 2008-2011, 2013, 2014, 2015, 2018 Free Software Foundation, Inc. +;; Copyright 2005,2008-2011,2013-2015,2017-2018 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public License @@ -29,6 +29,7 @@ ;;; Code: (define-module (scripts compile) + #:use-module ((system base language) #:select (lookup-language)) #:use-module ((system base compile) #:select (compile-file)) #:use-module (system base target) #:use-module (system base message) @@ -212,6 +213,13 @@ Report bugs to <~A>.~%" %guile-bug-report-address) (exit 0))) + ;; Load FROM and TO before we have changed the load path. That way, when + ;; cross-compiling Guile itself, we can be sure we're loading our own + ;; language modules and not those of the Guile being compiled, which may + ;; have incompatible .go files. + (lookup-language from) + (lookup-language to) + (set! %load-path (append load-path %load-path)) (set! %load-should-auto-compile #f) |