gnu: Update coq and its dependents
[jackhill/guix/guix.git] / gnu / packages / gcc.scm
index e0e2361..4d5aaa7 100644 (file)
@@ -9,6 +9,7 @@
 ;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Joseph LaFreniere <joseph@lafreniere.xyz>
 ;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
+;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -514,6 +515,12 @@ Go.  It also includes runtime support libraries for these languages.")
 
     (inputs
      `(("isl" ,isl)
+
+       ;; XXX: This gross hack allows us to have libstdc++'s <bits/c++config.h>
+       ;; in the search path, thereby avoiding misconfiguration of libstdc++:
+       ;; <https://bugs.gnu.org/42392>.
+       ("libstdc++" ,libstdc++-headers)
+
        ,@(package-inputs gcc-4.7)))))
 
 (define-public gcc-7
@@ -607,6 +614,31 @@ using compilers other than GCC."
     (propagated-inputs '())
     (synopsis "GNU C++ standard library")))
 
+(define libstdc++
+  ;; Libstdc++ matching the default GCC.
+  (make-libstdc++ gcc))
+
+(define libstdc++-headers
+  ;; XXX: This package is for internal use to work around
+  ;; <https://bugs.gnu.org/42392> (see above).  The main difference compared
+  ;; to the libstdc++ headers that come with 'gcc' is that <bits/c++config.h>
+  ;; is right under include/c++ and not under
+  ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR).
+  (package
+    (inherit libstdc++)
+    (name "libstdc++-headers")
+    (outputs '("out"))
+    (build-system trivial-build-system)
+    (arguments
+     '(#:builder (let* ((out       (assoc-ref %outputs "out"))
+                        (libstdc++ (assoc-ref %build-inputs "libstdc++")))
+                   (mkdir out)
+                   (mkdir (string-append out "/include"))
+                   (symlink (string-append libstdc++ "/include")
+                            (string-append out "/include/c++")))))
+    (inputs `(("libstdc++" ,libstdc++)))
+    (synopsis "Headers of GNU libstdc++")))
+
 (define-public libstdc++-4.9
   (make-libstdc++ gcc-4.9))
 
@@ -689,7 +721,13 @@ as the 'native-search-paths' field."
 
 (define-public gfortran
   (hidden-package
-   (custom-gcc gcc "gfortran" '("fortran")
+   (custom-gcc (package
+                 (inherit gcc)
+                 ;; XXX: Remove LIBSTDC++-HEADERS from the inputs just to
+                 ;; avoid a rebuild of all the GFORTRAN dependents.
+                 ;; TODO: Remove this hack on the next rebuild cycle.
+                 (inputs (alist-delete "libstdc++" (package-inputs gcc))))
+               "gfortran" '("fortran")
                %generic-search-paths)))
 
 (define-public gdc-10
@@ -722,11 +760,26 @@ as the 'native-search-paths' field."
                (for-each delete-file
                          (find-files (string-append (assoc-ref outputs "out") "/bin")
                                      ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
-               #t))))))))
+               #t))))))
+    (synopsis "GCC library generating machine code on-the-fly at runtime")
+    (description
+     "This package is part of the GNU Compiler Collection and provides an
+embeddable library for generating machine code on-the-fly at runtime.  This
+shared library can then be dynamically-linked into bytecode interpreters and
+other such programs that want to generate machine code on-the-fly at run-time.
+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 gccgo-4.9
-  (custom-gcc gcc-4.9 "gccgo" '("go")
+  (custom-gcc (package
+                (inherit gcc-4.9)
+                (synopsis "Go frontend to GCC")
+                (description
+                 "This package is part of the GNU Compiler Collection and
+provides the GNU compiler for the Go programming language."))
+              "gccgo" '("go")
               %generic-search-paths
               ;; Suppress the separate "lib" output, because otherwise the
               ;; "lib" and "out" outputs would refer to each other, creating