From unknown Wed Aug 20 06:39:28 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Jul 2021 10:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49569 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49569@debbugs.gnu.org Cc: Efraim Flashner X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16263435941866 (code B ref -1); Thu, 15 Jul 2021 10:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Jul 2021 10:06:34 +0000 Received: from localhost ([127.0.0.1]:46878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yGI-0000U2-J5 for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:06:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:44728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yGH-0000Tu-2c for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:06:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yGG-0001uc-Sl for guix-patches@gnu.org; Thu, 15 Jul 2021 06:06:32 -0400 Received: from flashner.co.il ([178.62.234.194]:32976) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yGE-0004ZQ-V3 for guix-patches@gnu.org; Thu, 15 Jul 2021 06:06:32 -0400 Received: from localhost (unknown [31.210.177.125]) by flashner.co.il (Postfix) with ESMTPSA id D9174402D0; Thu, 15 Jul 2021 10:05:52 +0000 (UTC) From: Efraim Flashner Date: Thu, 15 Jul 2021 13:04:52 +0300 Message-Id: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) * gnu/packages/llvm.scm (make-single-arch-llvm): New procedure. (llvm-native-12, llvm-native): New variables. --- Using this copy of llvm for packages like mesa will reduce the closure of those packages. I don't suppose it would work as well for compilers like rust which use LLVM for compiling and targeting different architectures. This drops the size of llvm-12 from 167M to 111M. gnu/packages/llvm.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 575c63c713..35cecdfd84 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1347,3 +1347,27 @@ LLVM.")))) (define-public ocaml-llvm-9 (make-ocaml-llvm llvm-9)) (define-public ocaml-llvm-10 (make-ocaml-llvm llvm-10)) (define-public ocaml-llvm-11 (make-ocaml-llvm llvm-11)) + +(define* (make-single-arch-llvm llvm #:optional (system (or (%current-target-system) + (%current-system)))) + (package + (inherit llvm) + (name (string-append "llvm-for-" (string-downcase + (system->llvm-target system)))) + (arguments + (substitute-keyword-arguments (package-arguments llvm) + ((#:configure-flags cf) + `(cons* ,(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target system)) + ,cf)))) + (synopsis "Compiler with support for a single architecture"))) + +(define-public llvm-native-12 + (package + (inherit (make-single-arch-llvm llvm-12)) + (name "llvm-native"))) + +(define-public llvm-native + (package + (inherit (make-single-arch-llvm llvm)) + (name "llvm-native"))) base-commit: 17c8fedc256406047c7a1e8317bc52641c621286 -- 2.32.0 From unknown Wed Aug 20 06:39:28 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Jul 2021 16:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49569 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 49569@debbugs.gnu.org Received: via spool by 49569-submit@debbugs.gnu.org id=B49569.162731804732349 (code B ref 49569); Mon, 26 Jul 2021 16:48:02 +0000 Received: (at 49569) by debbugs.gnu.org; 26 Jul 2021 16:47:27 +0000 Received: from localhost ([127.0.0.1]:51380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m83lH-0008Ph-4q for submit@debbugs.gnu.org; Mon, 26 Jul 2021 12:47:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m83lC-0008PR-Dz for 49569@debbugs.gnu.org; Mon, 26 Jul 2021 12:47:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47748) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m83l6-0005lj-Lx; Mon, 26 Jul 2021 12:47:16 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45306 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m83l6-0006WA-EG; Mon, 26 Jul 2021 12:47:16 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> Date: Mon, 26 Jul 2021 18:47:14 +0200 In-Reply-To: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> (Efraim Flashner's message of "Thu, 15 Jul 2021 13:04:52 +0300") Message-ID: <87a6m981kd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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-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, Efraim Flashner skribis: > * gnu/packages/llvm.scm (make-single-arch-llvm): New procedure. > (llvm-native-12, llvm-native): New variables. > --- > > Using this copy of llvm for packages like mesa will reduce the closure > of those packages. I don't suppose it would work as well for compilers > like rust which use LLVM for compiling and targeting different > architectures. > > This drops the size of llvm-12 from 167M to 111M. That=E2=80=99s less impressive than I would have thought. For Mesa perhaps we could maybe have a variant that=E2=80=99s even more stripped? The downside of this is that we risk having several LLVM copies on typical installations. Thoughts? Thanks, Ludo=E2=80=99. From unknown Wed Aug 20 06:39:28 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Jul 2021 12:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49569 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 49569@debbugs.gnu.org Received: via spool by 49569-submit@debbugs.gnu.org id=B49569.162738905315050 (code B ref 49569); Tue, 27 Jul 2021 12:31:02 +0000 Received: (at 49569) by debbugs.gnu.org; 27 Jul 2021 12:30:53 +0000 Received: from localhost ([127.0.0.1]:52666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8MEW-0003ug-Mi for submit@debbugs.gnu.org; Tue, 27 Jul 2021 08:30:52 -0400 Received: from flashner.co.il ([178.62.234.194]:50538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8MER-0003uO-KT for 49569@debbugs.gnu.org; Tue, 27 Jul 2021 08:30:50 -0400 Received: from localhost (unknown [31.210.177.125]) by flashner.co.il (Postfix) with ESMTPSA id E8FF240224; Tue, 27 Jul 2021 12:30:40 +0000 (UTC) Date: Tue, 27 Jul 2021 15:29:29 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?UTF-8?Q?Court=C3=A8s?= , 49569@debbugs.gnu.org References: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> <87a6m981kd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DdIaWFrhKJQMmFIM" Content-Disposition: inline In-Reply-To: <87a6m981kd.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-Spam-Score: -0.0 (/) 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: -1.0 (-) --DdIaWFrhKJQMmFIM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 26, 2021 at 06:47:14PM +0200, Ludovic Court=C3=A8s wrote: > Hi, >=20 > Efraim Flashner skribis: >=20 > > * gnu/packages/llvm.scm (make-single-arch-llvm): New procedure. > > (llvm-native-12, llvm-native): New variables. > > --- > > > > Using this copy of llvm for packages like mesa will reduce the closure > > of those packages. I don't suppose it would work as well for compilers > > like rust which use LLVM for compiling and targeting different > > architectures. > > > > This drops the size of llvm-12 from 167M to 111M. >=20 > That=E2=80=99s less impressive than I would have thought. >=20 > For Mesa perhaps we could maybe have a variant that=E2=80=99s even more > stripped? >=20 > The downside of this is that we risk having several LLVM copies on > typical installations. >=20 > Thoughts? >=20 > Thanks, > Ludo=E2=80=99. I think you're mostly shocked by the large numbers, it is a drop of 33%. It turns out that llvm-julia uses something similar to only target one arch, so the idea's there somewhere. We could probably add it in there too for dlang. Icecat/icedove/mozjs-78 should be OK to switch. And xf86-video-vmware already has mesa as an input and could likely use a special llvm-for-mesa version. I can look at mesa and see which libraries from llvm it links to and see about just building those. A first look shows 50 llvm libraries from mesa and about 150 from llvm@11, with the 4 libraries being libOSMesa libvulkan_radeon libxatracker libXvMCnouveau --=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 --DdIaWFrhKJQMmFIM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmD//CgACgkQQarn3Mo9 g1EW5Q//ayy0RkOmKyvc8SdttL6W7bUVUrfOWsIJyRRX+iGg/Mlt51ioqGPYwE6+ GMfiC+5iO/CSUpGewyZDZywCLPKH1GSKYDW1aZ+GLAcEs9V5zznFurGo4zj4Pry6 fWIRLjo9UOnwIEFaSmURitK7F6PyQyuBEu0lJw1IUdjMqLxzEYhQrHHTCYbkVFQm pig7l/Bj1unfuIGNlHTuS1f7cCLgYEDJopthvgPdIq+ekUi8+fMaDu78B+/PzMfM Gjzs7I4noiYfdU0HWAWZxTGFEqwONCHxOPQ3oiA3fSgdSMlyjbDRCcfyCxNLiHfc ZVEOWBhM/t+lK19uA8+fxg0yhDcHxXLN2pj50ZKWTYsDOl07+PFoEF1UBerDCH0B acGxmiEiVqgOe5LxfiYDb0iLbwKWdl5lDiI7BtAzDC612/CaF9OMLYInSSPIvRxe edvjj+FrlBMIzBqfam6RGOJwXowOGoCwRDj3hO8rQWHkuwsat1L5AHbG6JE33XOg y8zqavrRAU+r/kY38fErdVLoZabUm+OvaJVYlfSiz8UeGrs4GghAfA/14lEIedL2 7OLTmEg6XHnKrw6vvuxMeDum2MrplwgVW7umYaA2ep4tNHwMpu/gkyE5BiI2d7/u Wc1rgYr8/E4mLecxhEIfT+v2l9WA/v+ghJLmWpiWW1H5MD01hHg= =6+C0 -----END PGP SIGNATURE----- --DdIaWFrhKJQMmFIM-- From unknown Wed Aug 20 06:39:28 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Jul 2021 13:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49569 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49569@debbugs.gnu.org, Efraim Flashner Received: via spool by 49569-submit@debbugs.gnu.org id=B49569.162739137818444 (code B ref 49569); Tue, 27 Jul 2021 13:10:01 +0000 Received: (at 49569) by debbugs.gnu.org; 27 Jul 2021 13:09:38 +0000 Received: from localhost ([127.0.0.1]:52684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8Mq2-0004nP-Bl for submit@debbugs.gnu.org; Tue, 27 Jul 2021 09:09:38 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:4132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8Mq0-0004nC-FT for 49569@debbugs.gnu.org; Tue, 27 Jul 2021 09:09:37 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id 0B2C01322; Tue, 27 Jul 2021 15:09:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1627391369; x=1629205770; bh=VXJkOZs1EmcHl6ON6UO05bDUlP4yTvAYpJs fJjpzN3c=; b=BHgXUZDZhkL1oGDKVCTzRTJR7c5Go7fwmdp10wn5GMP8jUwm3hx e8PBx66ZlhG8vzhHVex8apDCAaDB3JJqLamdBevQlyyYaNa9n6cYH2UNC4GMt9uq nA8fu6GMPPpQHMcZ1IWcF9ghG1RKmV6KVs/4h2Ez435wj5Zm9auEukMNO7lT3eDm Rf/6U4PZvHWdtvy4ns+ybH6II3OW9kBrKwQ6X6PVQx3fk/G2P9othF/Uw08hJmXH L3DbCfT1w2YTbChuEw1v9+ZKXm3b24+FjUwfujejyETseuqH9S62wox/zpaZPVJV 63b7PFBhteJBWavbSYQskR1P4MH5nTtIFESJxIeU+MdBfbX/O1fyKwcxDqQkMUxy h3x8C2HZmMPmRnPiYyF+QMjiNUWt8JIFIkkRfH9psawjL7BrZ0dZDBp4cEe4oUw/ yMK7SUSbEvud1XKussm6ce7XoqYqEavKQd2u3wVJniEB6lUwIO4rVkfNKGc5iTFs GahYU5oKGL85KPjcK4VFhFL+m4/tqTNgLdkldYQq9QyK3fzWKXAqkiYoZkTvEuob wS9sqHSfqh4+8k/mhKBE9pB3QhZK7oQIL6Xo0Kjt+vaGva5A7FkVM8VcQr3+Xarq jt1/sYniaSdkPlUiHbT6u7xvs7hBRH1xZ3kQ24RseMRV8B95Eq6knoN8= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.899 X-Spam-Level: X-Spam-Status: No, score=-1.899 tagged_above=-10 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h7DgRwTFszlf; Tue, 27 Jul 2021 15:09:29 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id 4923D1065; Tue, 27 Jul 2021 15:09:29 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx002.mykolab.com (Postfix) with ESMTPS id EC13F583D; Tue, 27 Jul 2021 15:09:27 +0200 (CEST) From: Thiago Jung Bauermann Date: Tue, 27 Jul 2021 10:09:19 -0300 Message-ID: <2615631.XO7ydEMPkx@popigai> In-Reply-To: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> References: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) 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: -1.0 (-) Hello, Em quinta-feira, 15 de julho de 2021, =C3=A0s 07:04:52 -03, Efraim Flashner escreveu: > * gnu/packages/llvm.scm (make-single-arch-llvm): New procedure. > (llvm-native-12, llvm-native): New variables. > --- >=20 > Using this copy of llvm for packages like mesa will reduce the closure > of those packages. I don't suppose it would work as well for compilers > like rust which use LLVM for compiling and targeting different > architectures. >=20 > This drops the size of llvm-12 from 167M to 111M. I don=E2=80=99t have an opinion on the issue that Ludo=E2=80=99 raised, jus= t one comment about the code below. > gnu/packages/llvm.scm | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) >=20 > diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm > index 575c63c713..35cecdfd84 100644 > --- a/gnu/packages/llvm.scm > +++ b/gnu/packages/llvm.scm > @@ -1347,3 +1347,27 @@ LLVM.")))) > (define-public ocaml-llvm-9 (make-ocaml-llvm llvm-9)) > (define-public ocaml-llvm-10 (make-ocaml-llvm llvm-10)) > (define-public ocaml-llvm-11 (make-ocaml-llvm llvm-11)) > + > +(define* (make-single-arch-llvm llvm #:optional (system (or (%current-ta= rget-system) > + (%current-sy= stem)))) > + (package > + (inherit llvm) > + (name (string-append "llvm-for-" (string-downcase > + (system->llvm-target system)))) =E2=80=98system->llvm-target=E2=80=99 needs a Nix system identifier but =E2=80=98%current-target-system=E2=80=99 contains a GNU triplet, so the abo= ve won=E2=80=99t work when cross-compiling for armhf-linux =E2=80=93 whose GNU triplet is =E2=80=9Carm-unknown-linux-gnueabihf=E2=80=9D. I suggest changing the default value of =E2=80=98system=E2=80=99 to (or (and=3D> (%current-target-system) gnu-triplet->nix-system) (%current-system)) which is the default argument for =E2=80=98system->llvm-target=E2=80=99. If I can add a shameless plug, patch 2 of my =E2=80=9CTarget check fixes and cleanups=E2=80=9D series=C2=B9 adds a helper procedure with the code above.= :-) > + (arguments > + (substitute-keyword-arguments (package-arguments llvm) > + ((#:configure-flags cf) > + `(cons* ,(string-append "-DLLVM_TARGETS_TO_BUILD=3D" > + (system->llvm-target system)) Same problem here. =2D-=20 Thanks, Thiago =C2=B9 https://issues.guix.gnu.org/49672 From unknown Wed Aug 20 06:39:28 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Jul 2021 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49569 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 49569@debbugs.gnu.org Received: via spool by 49569-submit@debbugs.gnu.org id=B49569.162740584726625 (code B ref 49569); Tue, 27 Jul 2021 17:11:02 +0000 Received: (at 49569) by debbugs.gnu.org; 27 Jul 2021 17:10:47 +0000 Received: from localhost ([127.0.0.1]:53778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8QbP-0006vN-Eb for submit@debbugs.gnu.org; Tue, 27 Jul 2021 13:10:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8QbO-0006vA-HK for 49569@debbugs.gnu.org; Tue, 27 Jul 2021 13:10:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55782) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8QbJ-0002Je-2q; Tue, 27 Jul 2021 13:10:41 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45316 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8QbH-0003iY-Kc; Tue, 27 Jul 2021 13:10:40 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> <87a6m981kd.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 Thermidor an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 27 Jul 2021 19:10:36 +0200 In-Reply-To: (Efraim Flashner's message of "Tue, 27 Jul 2021 15:29:29 +0300") Message-ID: <87o8an3coj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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-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 (---) Efraim Flashner skribis: > On Mon, Jul 26, 2021 at 06:47:14PM +0200, Ludovic Court=C3=A8s wrote: >> Hi, >>=20 >> Efraim Flashner skribis: >>=20 >> > * gnu/packages/llvm.scm (make-single-arch-llvm): New procedure. >> > (llvm-native-12, llvm-native): New variables. >> > --- >> > >> > Using this copy of llvm for packages like mesa will reduce the closure >> > of those packages. I don't suppose it would work as well for compilers >> > like rust which use LLVM for compiling and targeting different >> > architectures. >> > >> > This drops the size of llvm-12 from 167M to 111M. >>=20 >> That=E2=80=99s less impressive than I would have thought. [...] > I think you're mostly shocked by the large numbers, it is a drop of 33%. > > It turns out that llvm-julia uses something similar to only target one > arch, so the idea's there somewhere. We could probably add it in there > too for dlang. Icecat/icedove/mozjs-78 should be OK to switch. And > xf86-video-vmware already has mesa as an input and could likely use a > special llvm-for-mesa version. OK, maybe that=E2=80=99d be an improvement, and indeed, 33% is not negligib= le. > I can look at mesa and see which libraries from llvm it links to and see > about just building those. A first look shows 50 llvm libraries from > mesa and about 150 from llvm@11, with the 4 libraries being > libOSMesa libvulkan_radeon libxatracker libXvMCnouveau Makes sense. Does Mesa require some special GPU compiler backend in addition to the native backend? Thanks, Ludo=E2=80=99. From unknown Wed Aug 20 06:39:28 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: Efraim Flashner Subject: bug#49569: closed (Re: bug#49569: [PATCH] gnu: Add make-single-arch-llvm procedure.) Message-ID: References: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> X-Gnu-PR-Message: they-closed 49569 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 49569@debbugs.gnu.org Date: Mon, 30 Jan 2023 18:13:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1675102381-8551-1" This is a multi-part message in MIME format... ------------=_1675102381-8551-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #49569: [PATCH] gnu: Add make-single-arch-llvm procedure. 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 49569@debbugs.gnu.org. --=20 49569: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D49569 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1675102381-8551-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 49569-done) by debbugs.gnu.org; 30 Jan 2023 18:12:45 +0000 Received: from localhost ([127.0.0.1]:50414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMYe4-0002DG-Jj for submit@debbugs.gnu.org; Mon, 30 Jan 2023 13:12:44 -0500 Received: from mail-ej1-f44.google.com ([209.85.218.44]:45972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMYe2-0002D3-0N for 49569-done@debbugs.gnu.org; Mon, 30 Jan 2023 13:12:42 -0500 Received: by mail-ej1-f44.google.com with SMTP id dr8so12699128ejc.12 for <49569-done@debbugs.gnu.org>; Mon, 30 Jan 2023 10:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=HE5QWdWiRnt51kqpNO3yNLCS7WPSTBAXV3HFY0O/pSk=; b=IzSblHeOuLWOQ4UbXpaU8Clnxqbpl4xdxuei6ZoZuLlL4h3hKntlPGdp6BQmqXVHUM Rl23rehRU6/O4R4lbiNkeTbnSPfMV1piAFNMHOrt1pbI8fibam4u9BOCO8SeoacHniwr ZtFx3T9hHJ9Ta8vb/1apvynN6brLc0zQM6K71h0D6ttbJI0xZE+a5h+YXuB4vOyXfmoC 6wRK+jTTD4aVZYlZDLXYTXj51BuIuiHmjmXYvgSYJFLoN4mMoCGldLfP8DydTKkMn6Se Epjt0q+q/MW7vAUSCDVMSJxUebKl2xayXFZT2+/5KD0zF/u0lIt1f1evK9jfOoOsVy46 w6TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HE5QWdWiRnt51kqpNO3yNLCS7WPSTBAXV3HFY0O/pSk=; b=DSPNuNjcVQOPo0U9bnHxKghoz985JQnu/R2KWDfeErd4YNbNu84IfIVu1K3hc6wz6P FM2A1AMCSdlo8R/WYYgKEkUwnfuh3hgqfl1cSDHFNwggP7T8ZejmT2+sG3xXsSCL0/4W 0iP6vV1W0w6pGEVG5TzgnHQAg2+IMAL7foImGzbxb7svFaMOBbyTer4Oo/XCOPmjMxb7 QR0URULg5fVjkgt09nCdgiJ5QswrYk2QmVwOr8JNZwabWF7FTmG1o+OO8jCTdTaTKM83 fkB4eAGL7E5uyKQ034fKvysYJO2Ex2V7Uym7EhPiyOkkLe2M0Ubw+Qq0LHfZ27wkTzdI Xy0w== X-Gm-Message-State: AFqh2kphteKevz/rwTVrqLHWE0JFBSSbhksgXFzqyKbHKRI/Wmh9DOn8 6c6l1dSzXiT21d0bN+YnSEI= X-Google-Smtp-Source: AMrXdXs3LVdgSeG7r8gBgMUPcP0EEbz/DZ3JjwmYFOVsUwWfeigmKvoCztF0ymrVtFC/UCi7M5nmow== X-Received: by 2002:a17:906:60d2:b0:872:6bd0:d2b with SMTP id f18-20020a17090660d200b008726bd00d2bmr46652181ejk.45.1675102356077; Mon, 30 Jan 2023 10:12:36 -0800 (PST) Received: from localhost ([141.226.15.115]) by smtp.gmail.com with ESMTPSA id z4-20020a170906714400b0087223b8d6efsm7319434ejj.16.2023.01.30.10.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 10:12:35 -0800 (PST) Date: Mon, 30 Jan 2023 20:12:33 +0200 From: Efraim Flashner To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49569: [PATCH] gnu: Add make-single-arch-llvm procedure. Message-ID: Mail-Followup-To: Efraim Flashner , Ludovic =?utf-8?Q?Court=C3=A8s?= , 49569-done@debbugs.gnu.org References: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> <87a6m981kd.fsf@gnu.org> <87o8an3coj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1+RDw9BVXGS4us8Z" Content-Disposition: inline In-Reply-To: <87o8an3coj.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-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 49569-done Cc: 49569-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: -0.8 (/) --1+RDw9BVXGS4us8Z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I think we can drop this with llvm-for-mesa in core-updates. --=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 --1+RDw9BVXGS4us8Z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmPYCJEACgkQQarn3Mo9 g1FC8w//YwZBfmF6mVbya0CPlSSIUzjQuBT9cdVAXBw+tcH9ib6+E4Y9oYPZXmXo 06+qOmRRUv4fb/NfFE4bb1sbNb4S4C+xM36roeNllDMg9fzYw8Jglw+GooU+U7gO DiXnRPwJLDgAXsimCWdoaELWElVHVR/7mWVXlZAt4P+vxTE1qSsU8xjtl1J5Ha3C cLe+hJ2tUSbB1oG8ZUgZ5NfW75mRik+wUBHmGz2K4DsPnr5x2Q8lwGW3lOtY78V9 KSkucsZ67M2SUSfZ64q5LhHDJ1GvCq3nK2UP/YN9Vz8T9cg9dPQ/T/MUH7/GIOZQ ZWPJXEzkmhdIThoA0MszhnXQAeBVRN2iYf5bKrG7Vx061X77lAVvUsIreW2ko4u8 j/BYM5j2U80d7RSGOAzeapx+nDXw6pTBp/edWEZaYyshvPUvqbw7R901gv4cK0/K jn8vhLltk2ExTzHUK+vpalOrPLDKmCGr6UapYLOMwB/L7iHAkMWZgZ2AiWRnz+6J A3/xa8olflh45TULb4x2SVCZGl/ceZ3IhQdlF/KOUzR5bFaV0SpNMhmY65vuRhm1 Oh733xr2b38hQS7VUI1+4/SQprVfOVu6GVmQG9TVT2AURSTEo+OWViVOH82RAasM cRpmDWvQofQ8EKRMoIn3N+wqD7cBwC2Z+97QRvT20z+4npKI86o= =OFAk -----END PGP SIGNATURE----- --1+RDw9BVXGS4us8Z-- ------------=_1675102381-8551-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Jul 2021 10:06:34 +0000 Received: from localhost ([127.0.0.1]:46878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yGI-0000U2-J5 for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:06:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:44728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yGH-0000Tu-2c for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:06:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yGG-0001uc-Sl for guix-patches@gnu.org; Thu, 15 Jul 2021 06:06:32 -0400 Received: from flashner.co.il ([178.62.234.194]:32976) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yGE-0004ZQ-V3 for guix-patches@gnu.org; Thu, 15 Jul 2021 06:06:32 -0400 Received: from localhost (unknown [31.210.177.125]) by flashner.co.il (Postfix) with ESMTPSA id D9174402D0; Thu, 15 Jul 2021 10:05:52 +0000 (UTC) From: Efraim Flashner To: guix-patches@gnu.org Subject: [PATCH] gnu: Add make-single-arch-llvm procedure. Date: Thu, 15 Jul 2021 13:04:52 +0300 Message-Id: <77ec80a001bb04229289f1e3efff7633c94c71dc.1626343320.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Efraim Flashner 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.3 (--) * gnu/packages/llvm.scm (make-single-arch-llvm): New procedure. (llvm-native-12, llvm-native): New variables. --- Using this copy of llvm for packages like mesa will reduce the closure of those packages. I don't suppose it would work as well for compilers like rust which use LLVM for compiling and targeting different architectures. This drops the size of llvm-12 from 167M to 111M. gnu/packages/llvm.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 575c63c713..35cecdfd84 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1347,3 +1347,27 @@ LLVM.")))) (define-public ocaml-llvm-9 (make-ocaml-llvm llvm-9)) (define-public ocaml-llvm-10 (make-ocaml-llvm llvm-10)) (define-public ocaml-llvm-11 (make-ocaml-llvm llvm-11)) + +(define* (make-single-arch-llvm llvm #:optional (system (or (%current-target-system) + (%current-system)))) + (package + (inherit llvm) + (name (string-append "llvm-for-" (string-downcase + (system->llvm-target system)))) + (arguments + (substitute-keyword-arguments (package-arguments llvm) + ((#:configure-flags cf) + `(cons* ,(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target system)) + ,cf)))) + (synopsis "Compiler with support for a single architecture"))) + +(define-public llvm-native-12 + (package + (inherit (make-single-arch-llvm llvm-12)) + (name "llvm-native"))) + +(define-public llvm-native + (package + (inherit (make-single-arch-llvm llvm)) + (name "llvm-native"))) base-commit: 17c8fedc256406047c7a1e8317bc52641c621286 -- 2.32.0 ------------=_1675102381-8551-1--