From f3b312a19d70293d7a3407fc4ef479183edd7cca Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Jun 2012 01:11:44 +0200 Subject: Fix cross-compilation of GOOPS-using code. Fixes . Reported by Bogdan A. Marinescu . * module/oop/goops/dispatch.scm (compute-dispatch-procedure)[comp]: Wrap `compile' call in (with-target %host-type ...). --- module/oop/goops/dispatch.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'module/oop/goops') 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)) -- cgit v1.2.3