From bf33a77ea784cd21e7b1a283c98c2fa76dec1f43 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Fri, 5 Aug 2022 05:29:58 +0200 Subject: gnu: Parameterize libgccjit. * gnu/packages/gcc.scm (make-libgccjit): New variable. (libgccjit): Define in terms of make-libgccjit. --- gnu/packages/gcc.scm | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 11ee631bf4..dd480e930d 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -968,31 +968,33 @@ as the 'native-search-paths' field." (custom-gcc gcc-11 "gdc" '("d") %generic-search-paths))) -(define-public libgccjit +(define-public (make-libgccjit gcc) (package - (inherit gcc-9) + (inherit gcc) (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)) + (substitute-keyword-arguments (package-arguments gcc) + ((#:modules _ '()) + '((guix build gnu-build-system) + (guix build utils) + (ice-9 regex) + (srfi srfi-1) + (srfi srfi-26))) ((#:configure-flags flags) - `(append `("--enable-host-shared" - ,(string-append "--enable-languages=jit")) + #~(cons* "--enable-host-shared" + "--enable-languages=jit" (remove (cut string-match "--enable-languages.*" <>) - ,flags))) + #$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-.*)")))))))) + #~(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-.*)")))))))) (synopsis "GCC library generating machine code on-the-fly at runtime") (description "This package is part of the GNU Compiler Collection and provides an @@ -1003,6 +1005,8 @@ It can also be used for ahead-of-time code generation for building standalone compilers. The just-in-time (jit) part of the name is now something of a misnomer."))) +(define-public libgccjit (make-libgccjit gcc-9)) + (define (make-gccgo gcc) "Return a gccgo package based on GCC." (let ((gccgo (custom-gcc gcc "gccgo" '("go") %generic-search-paths))) -- cgit v1.2.3 From 6b6357155771b94c0ebbb1f879e2959fad42e9f5 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Fri, 5 Aug 2022 20:27:48 +0200 Subject: gnu: libgccjit: Build with bootstrapped gcc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gcc.scm (make-libgccjit)[#:configure-flags]: Add “--disable-bootstrap”, “--disable-libatomic”, “--disable-libgomp”, “--disable-libquadmath”, “--disable-libssp”, and “--enable-checking=release”. [inputs]: Remove libstdc++. [native-inputs]: Add gcc. --- gnu/packages/gcc.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index dd480e930d..046730b39e 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -983,7 +983,13 @@ as the 'native-search-paths' field." (srfi srfi-1) (srfi srfi-26))) ((#:configure-flags flags) - #~(cons* "--enable-host-shared" + #~(cons* "--disable-bootstrap" + "--disable-libatomic" + "--disable-libgomp" + "--disable-libquadmath" + "--disable-libssp" + "--enable-host-shared" + "--enable-checking=release" "--enable-languages=jit" (remove (cut string-match "--enable-languages.*" <>) #$flags))) @@ -995,6 +1001,10 @@ as the 'native-search-paths' field." (find-files (string-append (assoc-ref outputs "out") "/bin") ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)")))))))) + (inputs (modify-inputs (package-inputs gcc) + (delete "libstdc++"))) + (native-inputs (modify-inputs (package-native-inputs gcc) + (prepend gcc))) (synopsis "GCC library generating machine code on-the-fly at runtime") (description "This package is part of the GNU Compiler Collection and provides an -- cgit v1.2.3 From 80a9b757e88dd37c3ce4b7be4207050a2dcbca6b Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Fri, 5 Aug 2022 20:30:01 +0200 Subject: gnu: libgccjit: Build multiple versions. * gnu/packages/gcc.scm (libgccjit-9, libgccjit-10, libgccjit-11) (libgccjit-12): New variables. (libgccjit): Update to libgccjit-10. --- gnu/packages/gcc.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 046730b39e..bb8a922d53 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -1015,7 +1015,12 @@ It can also be used for ahead-of-time code generation for building standalone compilers. The just-in-time (jit) part of the name is now something of a misnomer."))) -(define-public libgccjit (make-libgccjit gcc-9)) +(define-public libgccjit-9 (make-libgccjit gcc-9)) +(define-public libgccjit-10 (make-libgccjit gcc-10)) +(define-public libgccjit-11 (make-libgccjit gcc-11)) +(define-public libgccjit-12 (make-libgccjit gcc-12)) + +(define-public libgccjit libgccjit-10) (define (make-gccgo gcc) "Return a gccgo package based on GCC." -- cgit v1.2.3