blob: b81f02e82afed7aa4f5393112c7c6544ff90b7ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
commit f3b312a19d70293d7a3407fc4ef479183edd7cca
Author: Ludovic Courtès <ludo@gnu.org>
Date: Wed Jun 20 01:11:44 2012 +0200
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 ...).
Upstream-Status: Backported
diff --git a/module/oop/goops/dispatch.scm b/module/oop/goops/dispatch.scm
index b12ab15..de5359f 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))
|