summaryrefslogtreecommitdiff
path: root/module/oop/goops
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-06-20 01:11:44 +0200
committerLudovic Courtès <ludo@gnu.org>2012-06-20 01:11:44 +0200
commitf3b312a19d70293d7a3407fc4ef479183edd7cca (patch)
treef6962d0f5d47282d60c4de3eb98f419c3ea124f6 /module/oop/goops
parent6b5e918e4f3cf011713e699c6af1c4e364bfae36 (diff)
downloadguile-f3b312a19d70293d7a3407fc4ef479183edd7cca.tar.gz
Fix cross-compilation of GOOPS-using code.
Fixes <http://bugs.gnu.org/11645>. Reported by Bogdan A. Marinescu <bogdan.a.marinescu@intel.com>. * module/oop/goops/dispatch.scm (compute-dispatch-procedure)[comp]: Wrap `compile' call in (with-target %host-type ...).
Diffstat (limited to 'module/oop/goops')
-rw-r--r--module/oop/goops/dispatch.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/oop/goops/dispatch.scm b/module/oop/goops/dispatch.scm
index b12ab15fa..de5359f3c 100644
--- a/module/oop/goops/dispatch.scm
+++ b/module/oop/goops/dispatch.scm
@@ -25,6 +25,7 @@
#:use-module (oop goops)
#:use-module (oop goops util)
#:use-module (oop goops compile)
+ #:use-module (system base target)
#:export (memoize-method!)
#:no-backtrace)
@@ -178,11 +179,15 @@
'())
(acons gf gf-sym '()))))
(define (comp exp vals)
- (let ((p ((@ (system base compile) compile) exp
- #:env *dispatch-module*
- #:opts '(#:partial-eval? #f #:cse? #f))))
- (apply p vals)))
-
+ ;; When cross-compiling Guile itself, the native Guile must generate
+ ;; code for the host.
+ (with-target %host-type
+ (lambda ()
+ (let ((p ((@ (system base compile) compile) exp
+ #:env *dispatch-module*
+ #:opts '(#:partial-eval? #f #:cse? #f))))
+ (apply p vals)))))
+
;; kick it.
(scan))