From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +JzBMLrVeGIpGQAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 10:50:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IH3nL7rVeGJMVAAAG6o9tA (envelope-from ) for ; Mon, 09 May 2022 10:50:02 +0200 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 48B88CEE7 for ; Mon, 9 May 2022 10:50:02 +0200 (CEST) Received: from localhost ([::1]:39098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnz5c-0005T2-Rt for larch@yhetil.org; Mon, 09 May 2022 04:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnz1n-0004mO-0j for bug-guix@gnu.org; Mon, 09 May 2022 04:46:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnz1m-0003ct-MS for bug-guix@gnu.org; Mon, 09 May 2022 04:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnz1m-0007LT-Ht for bug-guix@gnu.org; Mon, 09 May 2022 04:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#55283: =?UTF-8?Q?=E2=80=98tests/guix-shell-export-manifest.sh=E2=80=99?= fails on aarch64-linux Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 09 May 2022 08:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55283 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Vagrant Cascadian , 55283@debbugs.gnu.org, Maxime Devos , raingloom Received: via spool by 55283-submit@debbugs.gnu.org id=B55283.165208590928143 (code B ref 55283); Mon, 09 May 2022 08:46:02 +0000 Received: (at 55283) by debbugs.gnu.org; 9 May 2022 08:45:09 +0000 Received: from localhost ([127.0.0.1]:56006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnz0u-0007Jq-Dw for submit@debbugs.gnu.org; Mon, 09 May 2022 04:45:08 -0400 Received: from flashner.co.il ([178.62.234.194]:55320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnz0s-0007J1-QG for 55283@debbugs.gnu.org; Mon, 09 May 2022 04:45:07 -0400 Received: from localhost (unknown [37.46.46.12]) by flashner.co.il (Postfix) with ESMTPSA id E1569402CE; Mon, 9 May 2022 08:45:00 +0000 (UTC) Date: Mon, 9 May 2022 11:44:28 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Vagrant Cascadian , 55283@debbugs.gnu.org, Maxime Devos , raingloom References: <87ee1761ci.fsf@inria.fr> <20220506022826.5089eb2c@riseup.net> <5d219586c7a9a5ed2d89b12db73385d9d55adeb9.camel@telenet.be> <871qx68g33.fsf@contorta> <87wney6vwq.fsf@contorta> <87wnevu0x1.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gwrveowPcJDX9e4j" Content-Disposition: inline In-Reply-To: <87wnevu0x1.fsf@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652086202; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=FSoZc2z8ubZ6S8EZtP7jWakBG15UhyDFRyt7xTQf8tM=; b=XMsrKISm9otgqLZscbZ8iwu9GhsvzocrltzH7VDEbYVhW0Vs9HvJFgxLu+Zwoj6RTajEyH ZInTS4XxwSky1kj7LI5n5hPPM1b5x3n+WB/obVZn8gO26bm7MI1T+d+ruC8Y+4M5jzEA0v 4PR0uMVqTYGWrgCdg7R0uzmwwn2UfgBfCAytNpaQgMZVtTmknAiaT4RF86TpcNf2XE5UsZ MNVF4b9Z/NRLoqQUpslxKthkZgxoRW0emqLJBtYmwz8X0pz3SRNEuywSgwkiu/4YyQVIgi zznLNhlNNVZfgsQ5WuwrFNN+fuh+FQzu4zoHvRt/O5+XjwOEUAaqDRPCLAYpfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652086202; a=rsa-sha256; cv=none; b=gCj34uGTxJ/rRMWVKe2yOYa1D14kSSztG0TYK+LCJTTx0aIo3nQ8sOFk33kXxEUyykKtsa ePFTRKLulNkLxIVjGHRZt2SpbEY0xmVkcRCcy40QbYZ3zMqSXNn9XILPjdZI/q2Zr5X411 BSHbckvaKTOc2+p0gdpTRsa9KkBhE01k+5AdmYEWTg3TTZB6GqBZ25VcbauABNO1hIkOMI 8ND0WnlFx8BPYQwJkfitfLyKvvDQc4OfDiRUIRQcTq45g8zLCfHa79AT9pO0JroxdZgy88 KS4U8VUF2BKXO81qqrXt6VTfv+f3+tAUnHcmPOsRcG+rmJVEv5ILlW+4foYRiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.20 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 48B88CEE7 X-Spam-Score: -6.20 X-Migadu-Scanner: scn0.migadu.com X-TUID: pKtddro925/w --gwrveowPcJDX9e4j Content-Type: multipart/mixed; boundary="yHWK/eEt4lpsIrvn" Content-Disposition: inline --yHWK/eEt4lpsIrvn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 09, 2022 at 12:14:50AM +0200, Ludovic Court=C3=A8s wrote: > Hi! >=20 > Vagrant Cascadian skribis: >=20 > > Well, I guess I answered my initial question by reading the error > > message... guix/cpu.scm ... how did that work before for things like > > cross-building, where /proc/cpuinfo is *definitely* wrong to get > > information about the architecture you're building for? >=20 > (guix cpu) is used when passing =E2=80=98--tune=E2=80=99, which is used f= or native > builds: >=20 > https://hpc.guix.info/blog/2022/01/tuning-packages-for-a-cpu-micro-arch= itecture/ I have a WIP patch for adding CPU detection for aarch64. Perhaps it'll help with the issues? --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --yHWK/eEt4lpsIrvn Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0005-WIP-guix-cpu-Add-detection-for-aarch64-CPUs.patch" Content-Transfer-Encoding: quoted-printable =46rom 26894a74e7a1ed861a170239e26d13f1298fe5ac Mon Sep 17 00:00:00 2001 Message-Id: <26894a74e7a1ed861a170239e26d13f1298fe5ac.1644401681.git.efraim= @flashner.co.il> In-Reply-To: References: =46rom: Efraim Flashner Date: Wed, 9 Feb 2022 12:07:55 +0200 Subject: [PATCH 5/5] WIP: guix: cpu: Add detection for aarch64 CPUs. * guix/cpu.scm (current-cpu): Extend existing implementation to also read cpuinfo from aarch64 machines. (cpu->gcc-architecture): Add case for aarch64. --- guix/cpu.scm | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/guix/cpu.scm b/guix/cpu.scm index 6d44599822..d4dbd5f6b8 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -66,25 +66,47 @@ (define (prefix? prefix) (match (read-line port) ((? eof-object?) #f) + ;; vendor for x86_64 and i686 ((? (prefix? "vendor_id") str) (match (string-tokenize str) (("vendor_id" ":" vendor) (loop vendor family model)))) + ;; vendor for aarch64 and armhf + ((? (prefix? "CPU implementer") str) + (match (string-tokenize str) + (("CPU" "implementer" ":" vendor) + (loop vendor family model)))) + ;; family for x86_64 and i686 ((? (prefix? "cpu family") str) (match (string-tokenize str) (("cpu" "family" ":" family) (loop vendor (string->number family) model)))) + ;; model for x86_64 and i686 ((? (prefix? "model") str) (match (string-tokenize str) (("model" ":" model) (loop vendor family (string->number model))) (_ (loop vendor family model)))) + ;; model for aarch64 and armhf + ((? (prefix? "CPU part") str) + (match (string-tokenize str) + (("CPU" "part" ":" model) + (loop vendor family (string->number (string-append "#x" (s= tring-drop model 2))))) + (_ + (loop vendor family model)))) + ;; flags for x86_64 and i686 ((? (prefix? "flags") str) (match (string-tokenize str) (("flags" ":" flags ...) (cpu (utsname:machine (uname)) vendor family model (list->set flags))))) + ;; flags for aarch64 and armhf + ((? (prefix? "Features") str) + (match (string-tokenize str) + (("Features" ":" flags ...) + (cpu (utsname:machine (uname)) + vendor family model (list->set flags))))) (_ (loop vendor family model)))))))) =20 @@ -192,6 +214,54 @@ (define (cpu->gcc-architecture cpu) ;; TODO: Recognize CENTAUR/CYRIX/NSC? =20 "x86_64")) + ("aarch64" + (pk (cpu-architecture cpu)(cpu-vendor cpu)(cpu-family cpu) (cpu-model= cpu)(cpu-flags cpu)) + ;; Currently returns ("aarch64" #f #f #f #< vhash: # insert: # ref: #>) + ;; Transcribed from GCC's list of aarch64 processors in aarch64-cores= =2Edef + (match (cpu-vendor cpu) + ("0x41" + (match (cpu-model cpu) + ((or #xd02 #xd04 #xd03 #xd07 #xd08 #xd09) + "armv8-a") + ((or #xd05 #xd0a #xd0b #xd0e #xd0d #xd41 #xd42 #xd4b #xd46 #xd43= #xd44 #xd41 #xd0c #xd4a) + "armv8.2-a") + (#xd40 + "armv8.4-a") + (#xd15 + "armv8-r") + ((or #xd46 #xd47 #xd48) + "armv9-a"))) + ("0x42" + "armv8.1-a") + ("0x43" + (match (cpu-model cpu) + ((or #x0a0 #x0a1 #x0a2 #x0a3) + "armv8-a") + ((or #x0b0 #x0b1 #x0b2 #x0b3 #x0b4 #x0b5) + "armv8.2-a") + (#x0b8 + "armv8.3-a"))) + ("0x46" + "armv8.2-a") + ("0x48" + "armv8.2-a") + ("0x50" + "armv8-a") + ("0x51" + (match (cpu-model cpu) + (#xC00 + "armv8-a") + (#x516 + "armv8.1-a") + (#xC01 + "armv8.4-a"))) + ("0x53" + "armv8-a") + ("0x68" + "armv8-a") + (_ + "armv8-a")) + "armv8-a") (architecture ;; TODO: AArch64. architecture))) --=20 2.34.0 --yHWK/eEt4lpsIrvn-- --gwrveowPcJDX9e4j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmJ41GkACgkQQarn3Mo9 g1FReg/+LBEz33awnHfDF0FJfsmyGqAiGVThIOnn8qcRaSvniHT/RZuHOF1mVMgB KsCYbrFo15OByZ3BzE8FvPlstfGMeOwD3HtVDhT32RMdZtf1zFpA4wZ3aCTwC3/4 Q8gcl/jHN7zdg6WhZcsdMBAzc7UmbDIVx5fEKkxcKNhXQoGwTiS8EkUiCYVOwhtI qLHv1N7BDPfjGmeLEEpcMnTiusV2XgEMTikarmprF5JiVY4xbj7p2kj2poQMi3ab VgLh5ClQE6rkAWNUwrEQUj+uQXwkHtg7jC/Fr9//Q3ksfhIhLwbqPdOMRJdpkU5f ZdxPJPhPQPQq3wASt97mrVGfQi6pKisZPZIh+8G4zKIjyhssxihf67mvpHTgQvW/ StVg6XqnEQNi6d8zKz3sQuCP6wL/aVz2ZujhalQd5GtNmew5faAJdpgXSCVf5fo8 XohUVlyX6VQV6NYvpaQCVqEkTPaDGWe4+OR6ftQ9/ZZBouNWZCjFK5QcfhVdzmYM fA2sC5Gg8xC5X6rSxc+/VU20rhGN3+iaIFEBqPC+xh5YT/X/LhpyPbXxrCH9AVR3 O7Tvzy7XejHu/0myy3z4J+3eOzhVfswVOATX4uoTvL7doXcyGHmWl7qCHSkppog+ 108Tjmnu20NdeaghhkRqHHxihrL/DwAsbUdiEboJoOxITSCw46s= =h0QV -----END PGP SIGNATURE----- --gwrveowPcJDX9e4j--