From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +PeMHu79h1/qBAAA0tVLHw (envelope-from ) for ; Thu, 15 Oct 2020 07:44:46 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ICl5Gu79h19bVAAAB5/wlQ (envelope-from ) for ; Thu, 15 Oct 2020 07:44:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0445194023C for ; Thu, 15 Oct 2020 07:44:46 +0000 (UTC) Received: from localhost ([::1]:57232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSxwK-000284-K3 for larch@yhetil.org; Thu, 15 Oct 2020 03:44:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSxvh-00025g-GD for bug-guix@gnu.org; Thu, 15 Oct 2020 03:44:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSxve-0005NH-Oy for bug-guix@gnu.org; Thu, 15 Oct 2020 03:44:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kSxve-0005Lb-Np for bug-guix@gnu.org; Thu, 15 Oct 2020 03:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44000: Guile-Git cross-compiled to i586-pc-gnu gets bytestructures wrong Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 15 Oct 2020 07:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44000 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 44000@debbugs.gnu.org Received: via spool by 44000-submit@debbugs.gnu.org id=B44000.160274778620455 (code B ref 44000); Thu, 15 Oct 2020 07:44:02 +0000 Received: (at 44000) by debbugs.gnu.org; 15 Oct 2020 07:43:06 +0000 Received: from localhost ([127.0.0.1]:54063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSxuk-0005Jq-B5 for submit@debbugs.gnu.org; Thu, 15 Oct 2020 03:43:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSxuj-0005JL-9N for 44000@debbugs.gnu.org; Thu, 15 Oct 2020 03:43:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45786) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSxud-000587-Vq for 44000@debbugs.gnu.org; Thu, 15 Oct 2020 03:42:59 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51800 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kSxud-0000Id-93 for 44000@debbugs.gnu.org; Thu, 15 Oct 2020 03:42:59 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87v9fccuml.fsf@inria.fr> Date: Thu, 15 Oct 2020 09:42:55 +0200 In-Reply-To: <87v9fccuml.fsf@inria.fr> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 15 Oct 2020 00:25:54 +0200") Message-ID: <871ri0c4u8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: upHR7mMdFFS0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skribis: > The problem is that the =E2=80=98cond-expand=E2=80=99 used to define =E2= =80=98arch32bit?=E2=80=99 is a > expansion-time thing when (cross-)building Bytestructures itself, so > it=E2=80=99s incorrect from cross-building from 64-bit to 32-bit. > > I believe that changing it to: > > (define arch32bit? (memq data-model '(ilp32 lp32))) > > would fix it because then the test would happen at run time. I confirm that the attached patch for Bytestructures solves the problem (running =E2=80=98guix pull=E2=80=99 in my childhurd :-)). Let=E2=80=99s see whether it needs to be adapted for inclusion upstream. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Correctly-define-intptr_t-co.-when-cross-compiling.patch >From a44d04ed3f7031b4ab95b2f0da81c7ab020304d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 15 Oct 2020 08:47:06 +0200 Subject: [PATCH] Correctly define 'intptr_t' & co. when cross-compiling. Fixes . * bytestructures/guile/numeric-data-model.scm (data-model): Export. * bytestructures/body/numeric.scm (arch32bit?): Check the value of DATA-MODEL rather than use 'cond-expand'. --- bytestructures/body/numeric.scm | 8 ++++---- bytestructures/guile/numeric-data-model.scm | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bytestructures/body/numeric.scm b/bytestructures/body/numeric.scm index 842575d..e23cc24 100644 --- a/bytestructures/body/numeric.scm +++ b/bytestructures/body/numeric.scm @@ -282,10 +282,10 @@ (define long-long int64) (define unsigned-long-long uint64) -(define arch32bit? (cond-expand - (lp32 #t) - (ilp32 #t) - (else #f))) +(define arch32bit? (case data-model + ((lp32) #t) + ((ilp32) #t) + (else #f))) (define intptr_t (if arch32bit? int32 diff --git a/bytestructures/guile/numeric-data-model.scm b/bytestructures/guile/numeric-data-model.scm index 773b6cd..bd40c69 100644 --- a/bytestructures/guile/numeric-data-model.scm +++ b/bytestructures/guile/numeric-data-model.scm @@ -1,4 +1,5 @@ -(define-module (bytestructures guile numeric-data-model)) +(define-module (bytestructures guile numeric-data-model) + #:export (data-model)) (import (system foreign)) (import (system base target)) -- 2.28.0 --=-=-=--