diff mbox series

[bug#40045] gnu: Add libgccjit.

Message ID 87tv2tnsoe.fsf@lafreniere.xyz
State Accepted
Headers show
Series [bug#40045] gnu: Add libgccjit. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

LaFreniere, Joseph March 12, 2020, 9:56 p.m. UTC
Patch file is attached.  I have no experience building or 
packaging GCC, so any feedback is appreciated.  That being said, I 
_believe_ this recipe follows the build instructions at 
https://gcc.gnu.org/onlinedocs/jit/internals/index.html#packaging-notes 
correctly.

This is toward the eventual goal of packaging gccemacs 
(https://akrl.sdf.org/gccemacs.html).

--
Joseph LaFreniere

Comments

Ludovic Courtès March 16, 2020, 1:07 p.m. UTC | #1
Hi!

"LaFreniere, Joseph" <joseph@lafreniere.xyz> skribis:

>>From 8b08b302f6bf601f5c95513a56b7b0b54b0dc95c Mon Sep 17 00:00:00 2001
> From: Joseph LaFreniere <joseph@lafreniere.xyz>
> Date: Wed, 11 Mar 2020 21:48:59 -0500
> Subject: [PATCH] gnu: Add libgccjit.
>
> * gnu/packages/gcc.scm (libgccjit): New variable.

LGTM!  I added a copyright line for you and pushed.

BTW, it seems that we can remove all the libraries under lib/ except
libgccjit.so itself (i.e., libgomp, libitm, etc.).  Could you give it a
try?

Thanks,
Ludo’.
diff mbox series

Patch

From 8b08b302f6bf601f5c95513a56b7b0b54b0dc95c Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Wed, 11 Mar 2020 21:48:59 -0500
Subject: [PATCH] gnu: Add libgccjit.

* gnu/packages/gcc.scm (libgccjit): New variable.
---
 gnu/packages/gcc.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index ead50bb1dc..03fdeb02e1 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -690,6 +690,34 @@  as the 'native-search-paths' field."
   ;; report two gfortran@5 that are in fact identical.
   gfortran-7)
 
+(define-public libgccjit
+  (package
+    (inherit gcc-9)
+    (name "libgccjit")
+    (outputs (delete "lib" (package-outputs gcc)))
+    (properties (alist-delete 'hidden? (package-properties gcc)))
+    (arguments
+     (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
+                                                (guix build utils)
+                                                (ice-9 regex)
+                                                (srfi srfi-1)
+                                                (srfi srfi-26))
+                                     ,@(package-arguments gcc))
+       ((#:configure-flags flags)
+        `(append `("--enable-host-shared"
+                   ,(string-append "--enable-languages=jit"))
+                 (remove (cut string-match "--enable-languages.*" <>)
+                         ,flags)))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'install 'remove-broken-or-conflicting-files
+             (lambda* (#:key outputs #:allow-other-keys)
+               (for-each delete-file
+                         (find-files (string-append (assoc-ref outputs "out") "/bin")
+                                     ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
+               #t))))))))
+
+
 (define-public gccgo-4.9
   (custom-gcc gcc-4.9 "gccgo" '("go")
               %generic-search-paths
-- 
2.25.1