From unknown Tue Aug 19 23:13:51 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#61259] [PATCH] utils: Add target-little-endian?. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sat, 04 Feb 2023 01:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61259 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61259@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by submit@debbugs.gnu.org id=B.167547327013791 (code B ref -1); Sat, 04 Feb 2023 01:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Feb 2023 01:14:30 +0000 Received: from localhost ([127.0.0.1]:40242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO78P-0003aM-HZ for submit@debbugs.gnu.org; Fri, 03 Feb 2023 20:14:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:46064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO78M-0003aA-5Q for submit@debbugs.gnu.org; Fri, 03 Feb 2023 20:14:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO78L-0005qd-NU for guix-patches@gnu.org; Fri, 03 Feb 2023 20:14:25 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO78H-0005S2-2x for guix-patches@gnu.org; Fri, 03 Feb 2023 20:14:25 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D8C253200488 for ; Fri, 3 Feb 2023 20:14:16 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 03 Feb 2023 20:14:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to; s=fm3; t=1675473256; x= 1675559656; bh=7+5o7PjZxcAcm2w9cihP+AywsEeXt9VX/Feq3cBqRuY=; b=R vpzLajSdcMpSBZswzNPwj9umCB8lZhzg3rSzJ3EchZqfky+ZzJoeUJ//JCx+eE76 1/X1E2p762VeSPl0FS60s6K8vTZl3XOdP83WVrVtzEOh5Y0aVxMJrEpqgt/uGkoo 7oMWNY2ntIhS9pa030ITpd5aFZhEe08mR4cSYP7gcpfjgA4Ab6mED4vSVIfEsiSA 93E8XGS4kBhCoqfCMSw+xftEy8QW899vLuHmhzpzCOe45+PiK2EbSBlHzh6RdCtv zzunXHLoq3lCt6p60bhK45FdqoOfZwPwn/QnYjcM+5PqzlHTOF6U75Suqb6J9sjy 6rXXFkShsiYaB3qNXxGaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1675473256; x=1675559656; bh=7+5o7PjZxcAcm2w9cihP+AywsEeX t9VX/Feq3cBqRuY=; b=Z4taD4oyuUNI2g9O9JYyB+nujCA9dz12ImNstuGyYF5b Dw3iCqWr5YeGBXNwMR05sr1Us9YopjAt7Co0J8SRsCNWJAhj9/RsAyUbgqxw72SW Npn/MKlbtrQzeMqd7W3ODccyuczQ7BkYs1g1jJItig1eIN3g2udYCgfPz5/sawbp ZwEgoOIArZ2zNT0RBhC/To99dwQiByJ0MyGhUBpuj2j4iUH9ghgWT7UclXah2ZhJ 6km726uzcvp4wXlOAbdkqQB2NkWwIkyUxkhz3xrZIEaYe2V/tlfp4Z+6fg+0ckEc 5Wo81LHMJFwCuW5xj4us/n/cyah6qviFa87HyCJufw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeguddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhh ihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhepvdevhfefheffke egtefhieeikeettdfghfeujeeuveekleehjeffteetveevgeeknecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiph hmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 3 Feb 2023 20:14:16 -0500 (EST) From: Philip McGrath Date: Fri, 3 Feb 2023 20:14:12 -0500 Message-Id: <376cd64a8f207dd957ec0ccf3ef7cd63d81dc70b.1675473088.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.25; envelope-from=philip@philipmcgrath.com; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) * guix/utils.scm (target-little-endian?): New function. * guix/build-system/meson.scm (make-machine-alist): Use it. * gnu/packages/chez.scm (nix-system->pbarch-machine-type): Likewise. --- gnu/packages/chez.scm | 9 ++++----- guix/build-system/meson.scm | 13 +++---------- guix/utils.scm | 8 ++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 0d22e2e20f..1f178d2c72 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021, 2022 Philip McGrath +;;; Copyright © 2021, 2022, 2023 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -251,10 +251,9 @@ (define* (nix-system->pbarch-machine-type #:optional (if (target-64bit? system) "64" "32") - ;; missing (guix utils) predicate target-little-endian? - (if (target-ppc32? system) - "b" - "l"))) + (if (target-little-endian? system) + "l" + "b"))) (define* (racket-cs-native-supported-system? #:optional (system diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index b0bf8cb6e6..7d413a991d 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -74,16 +74,9 @@ (define (make-machine-alist triplet) ;; for selecting optimisations, so set it to something ;; arbitrary. (#t "strawberries"))) - (endian . ,(cond ((string-prefix? "powerpc64le-" triplet) "little") - ((string-prefix? "mips64el-" triplet) "little") - ((target-x86-32? triplet) "little") - ((target-x86-64? triplet) "little") - ;; At least in Guix. Aarch64 and 32-bit arm - ;; have a big-endian mode as well. - ((target-arm? triplet) "little") - ((target-ppc32? triplet) "big") - ((target-riscv64? triplet) "little") - (#t (error "meson: unknown architecture")))))) + (endian . ,(if (target-little-endian? triplet) + "little" + "big")))) (define (make-binaries-alist triplet) "Make an associatoin list describing what should go into diff --git a/guix/utils.scm b/guix/utils.scm index aca0af4e4b..774b80cd25 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2022 Taiju HIGASHI ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2022 Antero Mejr +;;; Copyright © 2023 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,7 @@ (define-module (guix utils) target-riscv64? target-mips64el? target-64bit? + target-little-endian? ar-for-target as-for-target cc-for-target @@ -744,6 +746,12 @@ (define* (target-64bit? #:optional (system (or (%current-target-system) (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64" "riscv64"))) +(define* (target-little-endian? #:optional (target (or (%current-target-system) + (%current-system)))) + "Is the architecture of TARGET little-endian?" + ;; At least in Guix. Aarch64 and 32-bit arm have a big-endian mode as well. + (not (target-ppc32? target))) + (define* (ar-for-target #:optional (target (%current-target-system))) (if target (string-append target "-ar") -- 2.39.1 From unknown Tue Aug 19 23:13:51 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philip McGrath Subject: bug#61259: closed (Re: bug#61259: [PATCH] utils: Add target-little-endian?.) Message-ID: References: <871qmxp2cn.fsf@gnu.org> <376cd64a8f207dd957ec0ccf3ef7cd63d81dc70b.1675473088.git.philip@philipmcgrath.com> X-Gnu-PR-Message: they-closed 61259 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 61259@debbugs.gnu.org Date: Fri, 10 Feb 2023 22:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1676069102-8173-1" This is a multi-part message in MIME format... ------------=_1676069102-8173-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61259: [PATCH] utils: Add target-little-endian?. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61259@debbugs.gnu.org. --=20 61259: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61259 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1676069102-8173-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61259-done) by debbugs.gnu.org; 10 Feb 2023 22:44:50 +0000 Received: from localhost ([127.0.0.1]:38275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQc8P-00027H-Q2 for submit@debbugs.gnu.org; Fri, 10 Feb 2023 17:44:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQc8N-000271-Vq for 61259-done@debbugs.gnu.org; Fri, 10 Feb 2023 17:44:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQc8I-0005hl-IL; Fri, 10 Feb 2023 17:44:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=7FCqQqTGt03RBFDrfeMCXrc+8beuKbaooPYORB1L7r4=; b=pQhKOz+KvsquLxEoKIy2 AvBx9Oqqu2v158v+icEuSTPhEXdLAFZrj+P0TYFira81tLCIepqhXN5um6+cjWqhfjM2rchtzVB5u Nf6EJocroEYmtpY1G8nLDrddGECO1Ej8b1s7+ltF4IAs8KAF0xms07HPxSzVj/PFQjWACTepO1q5P EeL6E3EegZIz1kDjyp/G7cxX01/P0VZaaZHxju1IAaSFMGQh0sVBL0WM/Z6au7lVh6jUfl406fQyO OtolupxrVRQly9ZVvt3ulHVlQPSu0+71d5kMjQRsWA5z2dMtqJ3zlJysCdbOprRtBWECAyyIz1hHD dH15NyKfe+P54A==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQc8I-0006Yg-4A; Fri, 10 Feb 2023 17:44:42 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Philip McGrath Subject: Re: bug#61259: [PATCH] utils: Add target-little-endian?. References: <376cd64a8f207dd957ec0ccf3ef7cd63d81dc70b.1675473088.git.philip@philipmcgrath.com> Date: Fri, 10 Feb 2023 23:44:40 +0100 In-Reply-To: <376cd64a8f207dd957ec0ccf3ef7cd63d81dc70b.1675473088.git.philip@philipmcgrath.com> (Philip McGrath's message of "Fri, 3 Feb 2023 20:14:12 -0500") Message-ID: <871qmxp2cn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61259-done Cc: 61259-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Philip, Philip McGrath skribis: > * guix/utils.scm (target-little-endian?): New function. > * guix/build-system/meson.scm (make-machine-alist): Use it. > * gnu/packages/chez.scm (nix-system->pbarch-machine-type): Likewise. Applied, thanks! Ludo=E2=80=99. ------------=_1676069102-8173-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Feb 2023 01:14:30 +0000 Received: from localhost ([127.0.0.1]:40242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO78P-0003aM-HZ for submit@debbugs.gnu.org; Fri, 03 Feb 2023 20:14:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:46064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO78M-0003aA-5Q for submit@debbugs.gnu.org; Fri, 03 Feb 2023 20:14:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO78L-0005qd-NU for guix-patches@gnu.org; Fri, 03 Feb 2023 20:14:25 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO78H-0005S2-2x for guix-patches@gnu.org; Fri, 03 Feb 2023 20:14:25 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D8C253200488 for ; Fri, 3 Feb 2023 20:14:16 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 03 Feb 2023 20:14:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to; s=fm3; t=1675473256; x= 1675559656; bh=7+5o7PjZxcAcm2w9cihP+AywsEeXt9VX/Feq3cBqRuY=; b=R vpzLajSdcMpSBZswzNPwj9umCB8lZhzg3rSzJ3EchZqfky+ZzJoeUJ//JCx+eE76 1/X1E2p762VeSPl0FS60s6K8vTZl3XOdP83WVrVtzEOh5Y0aVxMJrEpqgt/uGkoo 7oMWNY2ntIhS9pa030ITpd5aFZhEe08mR4cSYP7gcpfjgA4Ab6mED4vSVIfEsiSA 93E8XGS4kBhCoqfCMSw+xftEy8QW899vLuHmhzpzCOe45+PiK2EbSBlHzh6RdCtv zzunXHLoq3lCt6p60bhK45FdqoOfZwPwn/QnYjcM+5PqzlHTOF6U75Suqb6J9sjy 6rXXFkShsiYaB3qNXxGaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1675473256; x=1675559656; bh=7+5o7PjZxcAcm2w9cihP+AywsEeX t9VX/Feq3cBqRuY=; b=Z4taD4oyuUNI2g9O9JYyB+nujCA9dz12ImNstuGyYF5b Dw3iCqWr5YeGBXNwMR05sr1Us9YopjAt7Co0J8SRsCNWJAhj9/RsAyUbgqxw72SW Npn/MKlbtrQzeMqd7W3ODccyuczQ7BkYs1g1jJItig1eIN3g2udYCgfPz5/sawbp ZwEgoOIArZ2zNT0RBhC/To99dwQiByJ0MyGhUBpuj2j4iUH9ghgWT7UclXah2ZhJ 6km726uzcvp4wXlOAbdkqQB2NkWwIkyUxkhz3xrZIEaYe2V/tlfp4Z+6fg+0ckEc 5Wo81LHMJFwCuW5xj4us/n/cyah6qviFa87HyCJufw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeguddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhh ihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhepvdevhfefheffke egtefhieeikeettdfghfeujeeuveekleehjeffteetveevgeeknecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiph hmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 3 Feb 2023 20:14:16 -0500 (EST) From: Philip McGrath To: guix-patches@gnu.org Subject: [PATCH] utils: Add target-little-endian?. Date: Fri, 3 Feb 2023 20:14:12 -0500 Message-Id: <376cd64a8f207dd957ec0ccf3ef7cd63d81dc70b.1675473088.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.25; envelope-from=philip@philipmcgrath.com; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) * guix/utils.scm (target-little-endian?): New function. * guix/build-system/meson.scm (make-machine-alist): Use it. * gnu/packages/chez.scm (nix-system->pbarch-machine-type): Likewise. --- gnu/packages/chez.scm | 9 ++++----- guix/build-system/meson.scm | 13 +++---------- guix/utils.scm | 8 ++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 0d22e2e20f..1f178d2c72 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021, 2022 Philip McGrath +;;; Copyright © 2021, 2022, 2023 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -251,10 +251,9 @@ (define* (nix-system->pbarch-machine-type #:optional (if (target-64bit? system) "64" "32") - ;; missing (guix utils) predicate target-little-endian? - (if (target-ppc32? system) - "b" - "l"))) + (if (target-little-endian? system) + "l" + "b"))) (define* (racket-cs-native-supported-system? #:optional (system diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index b0bf8cb6e6..7d413a991d 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -74,16 +74,9 @@ (define (make-machine-alist triplet) ;; for selecting optimisations, so set it to something ;; arbitrary. (#t "strawberries"))) - (endian . ,(cond ((string-prefix? "powerpc64le-" triplet) "little") - ((string-prefix? "mips64el-" triplet) "little") - ((target-x86-32? triplet) "little") - ((target-x86-64? triplet) "little") - ;; At least in Guix. Aarch64 and 32-bit arm - ;; have a big-endian mode as well. - ((target-arm? triplet) "little") - ((target-ppc32? triplet) "big") - ((target-riscv64? triplet) "little") - (#t (error "meson: unknown architecture")))))) + (endian . ,(if (target-little-endian? triplet) + "little" + "big")))) (define (make-binaries-alist triplet) "Make an associatoin list describing what should go into diff --git a/guix/utils.scm b/guix/utils.scm index aca0af4e4b..774b80cd25 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2022 Taiju HIGASHI ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2022 Antero Mejr +;;; Copyright © 2023 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,7 @@ (define-module (guix utils) target-riscv64? target-mips64el? target-64bit? + target-little-endian? ar-for-target as-for-target cc-for-target @@ -744,6 +746,12 @@ (define* (target-64bit? #:optional (system (or (%current-target-system) (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "powerpc64" "riscv64"))) +(define* (target-little-endian? #:optional (target (or (%current-target-system) + (%current-system)))) + "Is the architecture of TARGET little-endian?" + ;; At least in Guix. Aarch64 and 32-bit arm have a big-endian mode as well. + (not (target-ppc32? target))) + (define* (ar-for-target #:optional (target (%current-target-system))) (if target (string-append target "-ar") -- 2.39.1 ------------=_1676069102-8173-1--