From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YEJQIWixg2LJdAAAbAwnHQ (envelope-from ) for ; Tue, 17 May 2022 16:30:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KIkjIWixg2JYRAEAauVa8A (envelope-from ) for ; Tue, 17 May 2022 16:30:00 +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 1DE7AC945 for ; Tue, 17 May 2022 16:29:55 +0200 (CEST) Received: from localhost ([::1]:56106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqyCw-0005nb-Oo for larch@yhetil.org; Tue, 17 May 2022 10:29:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqwox-0003px-3Y for guix-patches@gnu.org; Tue, 17 May 2022 09:01:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqwow-0000Ir-Pj for guix-patches@gnu.org; Tue, 17 May 2022 09:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nqwow-0001bK-FH for guix-patches@gnu.org; Tue, 17 May 2022 09:01:02 -0400 Subject: bug#55431: [PATCH] guix: cpu: recognize other architectures. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 17 May 2022 13:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 55431 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 55431-done@debbugs.gnu.org Received: via spool by 55431-done@debbugs.gnu.org id=D55431.16527924146069 (code D ref 55431); Tue, 17 May 2022 13:01:02 +0000 Received: (at 55431-done) by debbugs.gnu.org; 17 May 2022 13:00:14 +0000 Received: from localhost ([127.0.0.1]:56045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqwo9-0001Zo-TV for submit@debbugs.gnu.org; Tue, 17 May 2022 09:00:14 -0400 Received: from flashner.co.il ([178.62.234.194]:50352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqwo7-0001YW-Tq for 55431-done@debbugs.gnu.org; Tue, 17 May 2022 09:00:12 -0400 Received: from localhost (unknown [31.210.180.235]) by flashner.co.il (Postfix) with ESMTPSA id C457B4021C; Tue, 17 May 2022 13:00:05 +0000 (UTC) Date: Tue, 17 May 2022 15:59:15 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Julien Lepiller , 55431-done@debbugs.gnu.org References: <20220515191132.288dc60d@sybil.lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CI51xbL9ICskQWbR" Content-Disposition: inline In-Reply-To: <20220515191132.288dc60d@sybil.lepiller.eu> 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: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" 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=1652797796; 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-to: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=xDorUxQsLRAjFYNtx7jG+F73AKk2ge8QEtstRuH1npI=; b=hvyKulDEvR7zQFfUiUGdeqlAb3mcAvafV5PC5/E3k9YlJB8STDvg1R7nZFz8Px9/KWUhyk 8ihsoiGEI3J9VrhdPuvtWoSS1NzCkr5KW7IyadYnLuKQh4aJ9RMAkrMuzX1xXyYjAGg7kc VdmlnUUIBB8zxxdkvyWDMiJTd7H0tbBz+fdPuqzl56hyhXGxQ92doGavMDg40kRn2YxasZ UC6zeuIDIyjc938da1w8D3eKoRi7eDl4Y2h3LZr/reI6/s+c4TLhzceYVH8T32flkEPwSb 9kVDodmzcUTkxK6RAFEa9OaTs3312MV7Z7L8JihlgX4fqfieMgmv73wUXopPDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652797796; a=rsa-sha256; cv=none; b=EY8x4Inlto64ITtKe0YNL+szA40JQvLpKe1oXU3cE8T7Xp9QOUgjrAQQMfmYtt3pk3PvEs 1vMfayIMtXlYx47j6ssq6NluNHXwiQqw4x0hyzhu/JrvSdX3s8lNneLY+m5AiKDpqEKnNs vVN6wXK1yl3r4e21N6wRHhYyYMIeyNANmwG4EWIApr6R9/mQgDI62WyEUWE73+iFEZWenM gbNDKxDPi/uFfY8odg6HvUnMbLYWpAQQ0wFPlJOHWyYb6+W+dKqSCtpT43hQh2CBPw60yK CIA09UQG0LaV8bFssF8vQ4YkCkse95fUrDIZRAsNdlnEI3RHtKiTksVlB+RThQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.64 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1DE7AC945 X-Spam-Score: -4.64 X-Migadu-Scanner: scn1.migadu.com X-TUID: P7a6Ysm1Wdxr --CI51xbL9ICskQWbR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 15, 2022 at 07:11:32PM +0200, Julien Lepiller wrote: > Hi Guix! >=20 > The attached patch lets (guix cpu) recognize other architectures. The > code of (current-cpu) is based on the content of /proc/cpuinfo which > can be pretty different on non-intel architectures. For instance, > here's a sample from an armhf machine: >=20 > processor : 0 > model name : ARMv7 Processor rev 4 (v7l) > BogoMIPS : 45.47 > Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls > vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 > CPU architecture: 7 > CPU variant : 0x0 > CPU part : 0xc07 > CPU revision : 4 >=20 > In particular, there's no flags entry, so (current-cpu) doesn't stop > until eof, and returns #f. >=20 > It's an issue because a test uses this code, for testing manifests with > --tune. If no cpu is returned, the test crashes: >=20 > In guix/transformations.scm: > 864:25 1 (_ _ _ _ ((package ad-hoc-package "gcc-toolchain") > (<80>) <80>)) In guix/cpu.scm: > 94:2 0 (cpu->gcc-architecture #f) >=20 > Since the test fails, the "guix" package doesn't build, and I can't > reconfigure on armhf or aarch64. (well armhf has other issues right > now...) >=20 > The attached patch changes the logic of the code to read all lines, > find information about the CPU even if it's an ARM CPU, and returns > always something (to prevent the crash) when it reads eof. This means > that it will return architecture information about the last CPU, > instead of the first. I don't think that's an issue because this code > is used for --tune which really only works on intel where you don't > have multiple CPUs with too different features. >=20 > WDYT? I just pushed mine without seeing yours, sorry. I did check the gcc source code and I found the options for determining the cpu flags for arm* processors in gcc/config/arm/arm-cpus.in. Do you think it'd be worth it to add detection for armv7 CPUs? Also, I'm pretty sure we can overlap armhf and aarch64 together, and i686 and x86_64 together, and then running 32-bit code on 64-bit processors will get a nice boost since it'll be tuned for the actual hardware. --=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 --CI51xbL9ICskQWbR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmKDnCAACgkQQarn3Mo9 g1F9nxAAiLl1p68ATITa1A88daLSr9cSqOQAkg/25f3Xgr43M60PE867KThMYD2i r9kHt5v9CTKN2AfjQkevz9svhbavcOfyiRKOKWBfVhglCPUdYyp2KZ9aAHyOCDGJ lb6rvbg9NYAzgHj4nm04uAVUEpApdLY4mgKZOWDvU+D5HbamOmnfgH+CPRlptkCm ItYKc0nl4XxzagxLWC25+tJzeXW/obw/ckCLkUXXzRBUxUP8TT8QgIHxzb3PxUWX G/cKRQKQqfrI732C3ZzEMTfkLGsOwG7itpxdnT1Zsi2wIOjQGHi9Zdou6HBCStry x6eNDUfewHxVw+TJcb6WWoP98GRKnR01LNchchOwo7RI1ODDHBM5ygnDrnLJo//U MZWBYv8I1SfP3lX/vXKc7EMLMT2OyQNSriDpj7JyolKonoUfKx/vgHepMz38hRhe AyHrPjqbotmB6eS1N4BMHmi8hm0rj592ujVjlW+hiniFPYd5dAO5j4QdkwNmgHYf p5Nc/edQkhDq3EqA2n7rBZa1WlSJ6/iwHy9f7MvK5aYS1xAaBVDnXPDDQWiq5OeZ 264//63N6JrymdAgl93LKJAUEXAeos0ue+7+aPc5nmcK/Jrvj5q/iUcdqg8sqkru DI9oY/SNCIJQ+DpCiRjPAAAEhbfU+lxWU1/wfwr3JhF3YfgoDNE= =2HEI -----END PGP SIGNATURE----- --CI51xbL9ICskQWbR--