From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AAf0J7cFAGHYPQAAgWs5BA (envelope-from ) for ; Tue, 27 Jul 2021 15:10:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oBnNI7cFAGFcVwAAB5/wlQ (envelope-from ) for ; Tue, 27 Jul 2021 13:10:15 +0000 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 731DFD00A for ; Tue, 27 Jul 2021 15:10:14 +0200 (CEST) Received: from localhost ([::1]:56154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8Mqb-0000rb-2L for larch@yhetil.org; Tue, 27 Jul 2021 09:10:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8MqQ-0000rF-FY for guix-patches@gnu.org; Tue, 27 Jul 2021 09:10:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8MqQ-0001eG-80 for guix-patches@gnu.org; Tue, 27 Jul 2021 09:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m8MqP-0004o5-Ph for guix-patches@gnu.org; Tue, 27 Jul 2021 09:10:01 -0400 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 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) 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-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" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627391415; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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:dkim-signature; bh=VXJkOZs1EmcHl6ON6UO05bDUlP4yTvAYpJsfJjpzN3c=; b=WNDz/HIIfworyOpZNx/ch7n8/3JDOIqaVM7QNEwFh+TQGENBT8/qhDKfV3SFZMKa+cmec9 7OUWluLPyhWg1y8A5CCj/TUyDiWK03sbmeg+BU2Tqc1k4ZPsXn2T+xG0bK9dElWKyUQqxT +2L6JiTkyeEJsI83BvLiHR0B7kwN/rr3YB6sdSHM+hD9Ikemoum1BnRhsKTrzosfjOSH0j PuEl3qAda98KGL1u9Y1pyLMssSHi58jhnzS6M6V6IipBl3J5CXzD/yPkA5sJkMv5wcDmyh AlLz3KokQdUWTZxKhfUtIVZMervFQ5cWYFSk/s8yubdvJZcifQ1/4iHQHBjf1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627391415; a=rsa-sha256; cv=none; b=qoX2p5QV3fFv6sCZ1gS+tSDlYqWnVrrji9nQWqCdqeULVJJQjW4am825BCjPEArdVKOPDk IpclP+usg0BIDTje15t6wmCtq5ba+NV9B2X98MI6gNhuEOTCg4uqSzyAbJygmbTfbnnKEP AdQiRbNnCBX7zyfjTJ6lU71EA35E4gx64ZipaS5j5lOVOzSL9y7N7PUV3UQqIG0pA8Yyps jUCEhS8gtJNKS1BeIG9WbbNh3rcgT4m8KjdV+cJAD8B6/ijE+bVqoWNGHSEPGukA2XH1Dt wG6EFBhE50pLAozryYeaLFzRxxw2aOBaIcQ0HiH0ZdqkFHJqmZTkUtpLZ6NCsg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=BHgXUZDZ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=BHgXUZDZ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 731DFD00A X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: L7FlHczegtmp 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