~ruther/guix-local

ref: b57b68aba645181b78bbdbef4ad908d60da03aa7 guix-local/gnu/packages/patches/guile-3.0.11-cross-compilation.patch -rw-r--r-- 1.0 KiB
b57b68ab — Cayetano Santos gnu: open-logic: Move to hdl 30 days ago
                                                                                
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
Fix cross-compilation of Guile 3.0.11:

  https://codeberg.org/guile/guile/issues/88

--- a/module/system/base/target.scm
+++ b/module/system/base/target.scm
@@ -45,15 +45,13 @@
 ;;;
 
 ;; Hacky way to get native pointer size without having to load (system
-;; foreign).
-(define-syntax %native-word-size
-  (lambda (stx)
-    (syntax-case stx ()
-      (id (identifier? #'id)
-          (cond
-           ((< most-positive-fixnum (ash 1 32)) 4)
-           ((< most-positive-fixnum (ash 1 64)) 8)
-           (else (error "unexpected!" most-positive-fixnum)))))))
+;; foreign).  Note: Use the value of 'most-positive-fixnum' available at
+;; run time, not a macro-expansion time, to ensure the correct value is
+;; used when cross-compiling.
+(define %native-word-size
+  (cond ((< most-positive-fixnum (ash 1 32)) 4)
+        ((< most-positive-fixnum (ash 1 64)) 8)
+        (else (error "unexpected!" most-positive-fixnum))))
 
 (define %target-type (make-fluid %host-type))
 (define %target-endianness (make-fluid (native-endianness)))