From: Christoph Buck <dev@icepic.de>
To: 74296@debbugs.gnu.org
Cc: "Christoph Buck" <dev@icepic.de>,
"Christopher Baines" <guix@cbaines.net>,
"Josselin Poiret" <dev@jpoiret.xyz>,
"Ludovic Courtès" <ludo@gnu.org>,
"Mathieu Othacehe" <othacehe@gnu.org>,
"Simon Tournier" <zimon.toutoune@gmail.com>,
"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#74296] [PATCH 1/1] guix: records: Fix abi check in cross compile context
Date: Sun, 10 Nov 2024 19:23:01 +0100 [thread overview]
Message-ID: <c31ee4b87114ec5785854395991bc46293d0202e.1731253918.git.dev@icepic.de> (raw)
In-Reply-To: <cover.1731253918.git.dev@icepic.de>
* 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(-)
diff --git a/guix/records.scm b/guix/records.scm
index dca1e3c2e7..2084499e36 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -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
--
2.45.1
next prev parent reply other threads:[~2024-11-11 0:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-10 16:43 [bug#74296] [PATCH 0/1] Fix abi mismatch error on boot for cross-compiled images Christoph Buck
2024-11-10 18:23 ` Christoph Buck [this message]
2024-11-12 22:40 ` Ludovic Courtès
2024-11-13 12:45 ` Christoph Buck
2024-11-16 7:05 ` Simon Tournier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c31ee4b87114ec5785854395991bc46293d0202e.1731253918.git.dev@icepic.de \
--to=dev@icepic.de \
--cc=74296@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=ludo@gnu.org \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.