all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure.
@ 2021-07-15 10:04 Efraim Flashner
  2021-07-26 16:47 ` Ludovic Courtès
  2021-07-27 13:09 ` [bug#49569] " Thiago Jung Bauermann via Guix-patches via
  0 siblings, 2 replies; 6+ messages in thread
From: Efraim Flashner @ 2021-07-15 10:04 UTC (permalink / raw)
  To: 49569; +Cc: Efraim Flashner

* 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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-30 18:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-15 10:04 [bug#49569] [PATCH] gnu: Add make-single-arch-llvm procedure Efraim Flashner
2021-07-26 16:47 ` Ludovic Courtès
2021-07-27 12:29   ` Efraim Flashner
2021-07-27 17:10     ` Ludovic Courtès
2023-01-30 18:12       ` bug#49569: " Efraim Flashner
2021-07-27 13:09 ` [bug#49569] " Thiago Jung Bauermann via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.