From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CCnHG+II8GCGzQAAgWs5BA (envelope-from ) for ; Thu, 15 Jul 2021 12:07:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CG22FeII8GBjXQAAbx9fmQ (envelope-from ) for ; Thu, 15 Jul 2021 10:07:30 +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 A5C642EA24 for ; Thu, 15 Jul 2021 12:07:29 +0200 (CEST) Received: from localhost ([::1]:58212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yHA-0002be-N9 for larch@yhetil.org; Thu, 15 Jul 2021 06:07:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yGk-0002Xt-9N for guix-patches@gnu.org; Thu, 15 Jul 2021 06:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3yGk-0005Ky-11 for guix-patches@gnu.org; Thu, 15 Jul 2021 06:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3yGj-0000Uz-PL for guix-patches@gnu.org; Thu, 15 Jul 2021 06:07:01 -0400 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-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626343649; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TF0DoOzHGb8OuLQPXDbMATLTjGBkymrkQ1VfSxNZURc=; b=WjB7Cu6Pgij8XNfWF3l1D43apiUgx7KYWo7SJ7qbL/cjPuh6oKlCxmguOqRV1Qk38PeUTP 8evkTJJ8gBz0mgxgQyKt1BmkxLkO4mjaGJikH04vlElFVe/aYXUcCCz/4zECebEVRGK4ag KRBYoX3QFpofzFIUThJgatnbMafHp/8yk/cGgLuXI47m7Ay67P95abaH5EygshZKopbS1L MwWFgMAs8luJyi8GQ6wyvWYXTtwYMRBmDs4xPFG7HBpfb9wgOFXzL/JMPfWffYFblSRNR/ C6Nuzi86uDHS897u1U0h4koSU+bOm7lKAqZkEtl9UNDtd4uhhFb38HSedUWDJA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626343649; a=rsa-sha256; cv=none; b=HkE9timdLIcsv6eSA0m517V4Brho0VcgV7W9PZeeOneI0Mv+WBlgmZ+9wHy1ofmiEXhoHy w4UcMlmWaUyRt+o8cIxaHoqJu+yGi5VsNr4Gea6hcrOdNdyHzAqPIo3IYk0rBmKnJqQi+V AUUdiO2i4MS73dbHACdNomc4j3BkKf+ZyDGaA1AL5sY+Qvuf7MXQhMrbSZu2wVCoumuQgp J4chLteeG727q0oKqJvdDtfO2t9j2UU4tIJUnK0kyEghIVbDVyYPRXMkSQN3/BLpM035Mp vvAXVStV9ANO1rS8pLfwKLtZgk6VdurlhKZQU3krLrW9ElVg6/GeN4fvpOOwew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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.60 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: A5C642EA24 X-Spam-Score: 2.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: w1JjUk8LRmqn * 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