[bug#74296,1/1] guix: records: Fix abi check in cross compile context
Commit Message
* guix/records.scm: Use 32bit hash value for abi check to prevent
`record-abi-mismatch-error` in a cross-compile context
Change-Id: I889747b1a2837bee8bf9b4de5729fdcf1b165380
---
guix/records.scm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
@@ -415,11 +415,13 @@ (define-syntax define-record-type*
;; list of symbols.
(syntax-case field-specs ()
(((field get properties ...) ...)
- (string-hash (object->string
- (syntax->datum #'((field properties ...) ...)))
- (cond-expand
- (guile-3 (target-most-positive-fixnum))
- (else most-positive-fixnum))))))
+ (let ((hash-value
+ (string-hash
+ (object->string (syntax->datum #'((field properties ...) ...))))))
+ (cond
+ ((< most-positive-fixnum (ash 1 32)) hash-value)
+ ((< most-positive-fixnum (ash 1 64)) (ash hash-value -32))
+ (else (error "unexpected!" most-positive-fixnum)))))))
(syntax-case s ()
((_ type syntactic-ctor ctor pred