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 mNBLGTkmeWI3twAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 16:33:29 +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 mFJmGDkmeWJaRwEAG6o9tA (envelope-from ) for ; Mon, 09 May 2022 16:33:29 +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 CF2A41F842 for ; Mon, 9 May 2022 16:33:28 +0200 (CEST) Received: from localhost ([::1]:41746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no4Rz-0000Y9-4N for larch@yhetil.org; Mon, 09 May 2022 10:33:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no4E2-0001zR-53 for bug-guix@gnu.org; Mon, 09 May 2022 10:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no4E1-0001D0-Rf for bug-guix@gnu.org; Mon, 09 May 2022 10:19:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1no4E1-0005ry-Ns for bug-guix@gnu.org; Mon, 09 May 2022 10:19:01 -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 14:19:01 +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: Maxime Devos Cc: Vagrant Cascadian , 55283@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , raingloom Received: via spool by 55283-submit@debbugs.gnu.org id=B55283.165210591722529 (code B ref 55283); Mon, 09 May 2022 14:19:01 +0000 Received: (at 55283) by debbugs.gnu.org; 9 May 2022 14:18:37 +0000 Received: from localhost ([127.0.0.1]:59003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no4Dc-0005rI-Ks for submit@debbugs.gnu.org; Mon, 09 May 2022 10:18:36 -0400 Received: from flashner.co.il ([178.62.234.194]:55840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no4Da-0005r4-Se for 55283@debbugs.gnu.org; Mon, 09 May 2022 10:18:35 -0400 Received: from localhost (unknown [37.46.46.12]) by flashner.co.il (Postfix) with ESMTPSA id AD1A7402DB; Mon, 9 May 2022 14:18:28 +0000 (UTC) Date: Mon, 9 May 2022 17:17:55 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Maxime Devos , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Vagrant Cascadian , 55283@debbugs.gnu.org, raingloom References: <87ee1761ci.fsf@inria.fr> <20220506022826.5089eb2c@riseup.net> <5d219586c7a9a5ed2d89b12db73385d9d55adeb9.camel@telenet.be> <871qx68g33.fsf@contorta> <87wney6vwq.fsf@contorta> <87wnevu0x1.fsf@gnu.org> <4d2747729262ac3e3f27d7e75f1dfb50da4c7fed.camel@telenet.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f2H24mQDkd8g4ZH5" Content-Disposition: inline In-Reply-To: <4d2747729262ac3e3f27d7e75f1dfb50da4c7fed.camel@telenet.be> 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=1652106809; 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=L/ktLo3KrzENYaPt61B00TqlGGzfc2LnWwDsh15Cg1E=; b=TKPqnetEf4ZZ44zIQdAbRSp2tqxw0woKllucH0UJfaYX6zaT0Wgm6HC2AuqHYg9ApIrUI0 CG9GYbVyP10AvwbPm5u86JHrUy09uaDp/a+witNF0eKEenHtxt6EVNDY57i2FExxWknVi9 JMNTKK8+XYfXbHu6xA5LaWG0a22iSAoLsEIMWznOLPcAJ8f9ZJkBVi3lYyqH3PmtQ75NL2 G6K75jBEKxULzQaW5cl14UZ7BLns4X3eSdzdB6AkT1W79n1Ii1ANz1CrZg0EC1pDz0LqX2 1s7ZFMGeUXagO+qMatL0uPGToqcvM7QuWydvYyYZJPw9SH6kuD8lENMTXBBv6g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652106809; a=rsa-sha256; cv=none; b=j52uTwNkPxUWXw7i+di2NB/j1MORs7biveL504NCk8KebTsDCuUS5Z4ZlZcJElw8PYc3g6 DETxBdI8aD5DLEkQA4nCmn+t0/lp9dEXzrLp0PAl14QUkk1ZWOeK5EVbGIffIP0ovaSHeU Kmi7+77Kftv2fwIxntNGNoWqWCIWgHYVezbspYthHyyY2gWIIOs63yf0dVR0+F+VHJrCDn fnf/2mV1vpR+nxHU+7AQdtlmDgQB9Ru/OsupKZv9a9ubS6ykll0kQb3QDGP5FpjFNq6p2X wx3ASGIeV+5w1ka2lLmCEAtn6xk53noG2OBIv2ebgnToZ/36ZArj07MHqagPoA== 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: -5.90 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: CF2A41F842 X-Spam-Score: -5.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: zq7aNc3ka2ND --f2H24mQDkd8g4ZH5 Content-Type: multipart/mixed; boundary="hACWaNCdaGFaTVH4" Content-Disposition: inline --hACWaNCdaGFaTVH4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 09, 2022 at 12:03:46PM +0200, Maxime Devos wrote: > Efraim Flashner schreef op ma 09-05-2022 om 11:44 [+0300]: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (loop vendor family (string->number (string-append > > "#x" (string-drop model 2))))) >=20 > #x is for hexadecimal, right? If so, this can be simplified by using > the second argument of=C2=A0string->number: (string->number (string-drop > model 2) 16). I hadn't realized that. I took the chance to take another look at it and now it actually works, not just fills in each field with #f. I also added more chips based on gcc-12 and fixed the fallback case. --=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 --hACWaNCdaGFaTVH4 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="guix-cpu-aarch64.diff" Content-Transfer-Encoding: quoted-printable diff --git a/guix/cpu.scm b/guix/cpu.scm index a44cd082f1..37ed6f0a18 100644 --- a/guix/cpu.scm +++ b/guix/cpu.scm @@ -62,31 +62,51 @@ (define (prefix? prefix) (lambda (port) (let loop ((vendor #f) (family #f) - (model #f)) + (model #f) + (flags (list->set '()))) (match (read-line port) ((? eof-object?) - #f) + (cpu (utsname:machine (uname)) + vendor family model flags)) + ;; vendor for x86_64 and i686 ((? (prefix? "vendor_id") str) (match (string-tokenize str) (("vendor_id" ":" vendor) - (loop vendor family model)))) + (loop vendor family model flags)))) + ;; vendor for aarch64 and armhf + ((? (prefix? "CPU implementer") str) + (match (string-tokenize str) + (("CPU" "implementer" ":" vendor) + (loop vendor family model flags)))) + ;; family for x86_64 and i686 ((? (prefix? "cpu family") str) (match (string-tokenize str) (("cpu" "family" ":" family) - (loop vendor (string->number family) model)))) + (loop vendor (string->number family) model flags)))) + ;; model for x86_64 and i686 ((? (prefix? "model") str) (match (string-tokenize str) (("model" ":" model) - (loop vendor family (string->number model))) + (loop vendor family (string->number model flags))) (_ - (loop vendor family model)))) + (loop vendor family model flags)))) + ;; model for aarch64 and armhf + ((? (prefix? "CPU part") str) + (match (string-tokenize str) + (("CPU" "part" ":" model) + (loop vendor family (string->number (string-drop model 2) = 16) flags)))) + ;; 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))))) + (loop vendor family model (list->set flags))))) + ;; flags for aarch64 and armhf + ((? (prefix? "Features") str) + (match (string-tokenize str) + (("Features" ":" flags ...) + (loop vendor family model (list->set flags))))) (_ - (loop vendor family model)))))))) + (loop vendor family model flags)))))))) =20 (define (cpu->gcc-architecture cpu) "Return the architecture name, suitable for GCC's '-march' flag, that @@ -191,6 +211,57 @@ (define (cpu->gcc-architecture cpu) ;; TODO: Recognize CENTAUR/CYRIX/NSC? =20 "x86_64")) + ("aarch64" + ;; Transcribed from GCC's list of aarch64 processors in aarch64-cores= =2Edef + ;; What to do with big.LITTLE cores? + (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 #xd49 #xd4f) + "armv9-a"))) + ("0x42" + "armv8.1-a") + ("0x43" + (match (cpu-model cpu) + ((or #x0a0 #x0a1 #x0a2 #x0a3) + "armv8-a") + (#x0af + "armv8.1-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") + ("0xC0" + "armv8.6-a") + (_ + "armv8-a")) + "armv8-a") (architecture - ;; TODO: AArch64. - architecture))) + ;; TODO: More architectures + (utsname:machine (uname))))) --hACWaNCdaGFaTVH4-- --f2H24mQDkd8g4ZH5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmJ5IpEACgkQQarn3Mo9 g1Frzw//SdUQiTrvGcFDeJqqVWDhzx2lJrcx15t2AJK+/RvsGQBA5fGGthZahiMJ Q1kXIqfaMTTiwqL6UjqYce6Bg1BunDKVYvIx1LUNGgKv5zOIge9doUOLTKrgzTp8 Bhi3U0uPRopAXwIE/BisOuAdmA+0OOEFwq9K0rpW4uy04R4UecomDH7eG4+G2Xf8 4jqFbQJjsCLruFi8bpQhHhYGCMlK5KYrFUBHzdZh9lOVieShfnj8kYRx4E+XUFSO w+FiSU1/qGhdkLeZI0n08fJelXhTbwuHZUpP+nOwMBtthig4Qbgg3zeC7mSwc3ON h2WgzdGSuU4Ig/wlYVfh/SRU5R+KQJDb/2UiTLSX/CiLhLo0vY5wHA9ApdDNCg2l YOd2OvXsrfnPozubRZ2qpoxhcwCtFmG6EI6tWBA3mmH/9Mo7RtKR4/3AX3C4PC/w OKww4KxMSegaOIRtJjwG6MCUOTZaJ3T+36pu+LJkZkaNir0jDV4Z5a3TFriNUEaE 5nkJDbsIuHp48AzizMAH8GyGve3aPwO5hLwC7k1v9ddGyHS6T7Rtpf+u6e5ssFkb 1QDw1HNIek2lzRuRcxcNAgMJSnFLdP/GfX/1nmCXRQ+xS+ZiyfUxuObSS5Kdlzaz zv+PyxiSnB77GjYRgTYjbJMVQGPT/k7t3mMQzNZ5m3M7yxvK9FE= =O+x1 -----END PGP SIGNATURE----- --f2H24mQDkd8g4ZH5--