gnu: facter: Update to 4.0.33.
[jackhill/guix/guix.git] / gnu / packages / gcc.scm
index 50c58c1..a39ac3b 100644 (file)
@@ -1,12 +1,14 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2014, 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Joseph LaFreniere <joseph@lafreniere.xyz>
+;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -139,220 +141,223 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                      (gcc-configure-flags-for-triplet triplet))
 
                    (maybe-target-tools))))))
-    (package
-      (name "gcc")
-      (version "4.7.4")
-      (source (origin
-               (method url-fetch)
-               (uri (string-append "mirror://gnu/gcc/gcc-"
-                                   version "/gcc-" version ".tar.bz2"))
-               (sha256
-                (base32
-                 "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
-               (patches (search-patches "gcc-4-compile-with-gcc-5.patch"
-                                        "gcc-fix-texi2pod.patch"))))
-      (build-system gnu-build-system)
-
-      ;; Separate out the run-time support libraries because all the
-      ;; dynamic-linked objects depend on it.
-      (outputs '("out"                    ;commands, etc. (60+ MiB)
-                 "lib"                    ;libgcc_s, libgomp, etc. (15+ MiB)
-                 "debug"))                ;debug symbols of run-time libraries
-
-      (inputs `(("gmp" ,gmp)
-                ("mpfr" ,mpfr)
-                ("mpc" ,mpc)
-                ("libelf" ,libelf)
-                ("zlib" ,zlib)))
-
-      ;; GCC < 5 is one of the few packages that doesn't ship .info files.
-      ;; Newer texinfos fail to build the manual, so we use an older one.
-      (native-inputs `(("perl" ,perl)   ;for manpages
-                       ("texinfo" ,texinfo-5)))
-
-      (arguments
-       `(#:out-of-source? #t
-         #:configure-flags ,(configure-flags)
-         #:make-flags
-         ;; None of the flags below are needed when doing a Canadian cross.
-         ;; TODO: Simplify this.
-         ,(if (%current-target-system)
-              (if stripped?
-                  ''("CFLAGS=-g0 -O2")
-                  ''())
-              `(let* ((libc        (assoc-ref %build-inputs "libc"))
-                      (libc-native (or (assoc-ref %build-inputs "libc-native")
-                                       libc)))
-                 `(,@(if libc
-                         (list (string-append "LDFLAGS_FOR_TARGET="
-                                              "-B" libc "/lib "
-                                              "-Wl,-dynamic-linker "
-                                              "-Wl," libc
-                                              ,(glibc-dynamic-linker)))
-                         '())
-
-                   ;; Native programs like 'genhooks' also need that right.
-                   ,(string-append "LDFLAGS="
-                                   "-Wl,-rpath=" libc-native "/lib "
-                                   "-Wl,-dynamic-linker "
-                                   "-Wl," libc-native ,(glibc-dynamic-linker))
-                   ,(string-append "BOOT_CFLAGS=-O2 "
-                                   ,(if stripped? "-g0" "-g")))))
-
-         #:tests? #f
-
-         #:phases
-         (modify-phases %standard-phases
-           (add-before 'configure 'pre-configure
-             (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let ((libdir ,(libdir))
-                     (libc   (assoc-ref inputs "libc")))
-                 (when libc
-                       ;; The following is not performed for `--without-headers'
-                       ;; cross-compiler builds.
-
-                       ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
-                       ;; single line, to allow the next step to work properly.
-                       (for-each
-                        (lambda (x)
-                          (substitute* (find-files "gcc/config"
-                                                   "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
-                            (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
-                             line)))
-                        '(1 2 3))
-
-                       ;; Fix the dynamic linker's file name.
+    (hidden-package
+     (package
+       (name "gcc")
+       (version "4.7.4")
+       (source (origin
+                 (method url-fetch)
+                 (uri (string-append "mirror://gnu/gcc/gcc-"
+                                     version "/gcc-" version ".tar.bz2"))
+                 (sha256
+                  (base32
+                   "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
+                 (patches (search-patches "gcc-4-compile-with-gcc-5.patch"
+                                          "gcc-fix-texi2pod.patch"))))
+       (build-system gnu-build-system)
+
+       ;; Separate out the run-time support libraries because all the
+       ;; dynamic-linked objects depend on it.
+       (outputs '("out"                    ;commands, etc. (60+ MiB)
+                  "lib"                    ;libgcc_s, libgomp, etc. (15+ MiB)
+                  "debug"))                ;debug symbols of run-time libraries
+
+       (inputs `(("gmp" ,gmp)
+                 ("mpfr" ,mpfr)
+                 ("mpc" ,mpc)
+                 ("libelf" ,libelf)
+                 ("zlib" ,zlib)))
+
+       ;; GCC < 5 is one of the few packages that doesn't ship .info files.
+       ;; Newer texinfos fail to build the manual, so we use an older one.
+       (native-inputs `(("perl" ,perl)   ;for manpages
+                        ("texinfo" ,texinfo-5)))
+
+       (arguments
+        `(#:out-of-source? #t
+          #:configure-flags ,(configure-flags)
+          #:make-flags
+          ;; None of the flags below are needed when doing a Canadian cross.
+          ;; TODO: Simplify this.
+          ,(if (%current-target-system)
+               (if stripped?
+                   ''("CFLAGS=-g0 -O2")
+                   ''())
+               `(let* ((libc        (assoc-ref %build-inputs "libc"))
+                       (libc-native (or (assoc-ref %build-inputs "libc-native")
+                                        libc)))
+                  `(,@(if libc
+                          (list (string-append "LDFLAGS_FOR_TARGET="
+                                               "-B" libc "/lib "
+                                               "-Wl,-dynamic-linker "
+                                               "-Wl," libc
+                                               ,(glibc-dynamic-linker)))
+                          '())
+
+                    ;; Native programs like 'genhooks' also need that right.
+                    ,(string-append "LDFLAGS="
+                                    "-Wl,-rpath=" libc-native "/lib "
+                                    "-Wl,-dynamic-linker "
+                                    "-Wl," libc-native ,(glibc-dynamic-linker))
+                    ,(string-append "BOOT_CFLAGS=-O2 "
+                                    ,(if stripped? "-g0" "-g")))))
+
+          #:tests? #f
+
+          #:phases
+          (modify-phases %standard-phases
+            (add-before 'configure 'pre-configure
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let ((libdir ,(libdir))
+                      (libc   (assoc-ref inputs "libc")))
+                  (when libc
+                    ;; The following is not performed for `--without-headers'
+                    ;; cross-compiler builds.
+
+                    ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
+                    ;; single line, to allow the next step to work properly.
+                    (for-each
+                     (lambda (x)
                        (substitute* (find-files "gcc/config"
                                                 "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
-                         (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
-                           _ gnu-user suffix)
-                          (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
-                                  gnu-user suffix
-                                  (string-append libc ,(glibc-dynamic-linker)))))
-
-                       ;; Tell where to find libstdc++, libc, and `?crt*.o', except
-                       ;; `crt{begin,end}.o', which come with GCC.
-                       (substitute* (find-files "gcc/config"
-                                                "^gnu-user.*\\.h$")
-                         (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
-                          ;; Help libgcc_s.so be found (see also below.)  Always use
-                          ;; '-lgcc_s' so that libgcc_s.so is always found by those
-                          ;; programs that use 'pthread_cancel' (glibc dlopens
-                          ;; libgcc_s.so when pthread_cancel support is needed, but
-                          ;; having it in the application's RUNPATH isn't enough; see
-                          ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
-                          ;;
-                          ;; NOTE: The '-lgcc_s' added below needs to be removed in a
-                          ;; later phase of %gcc-static.  If you change the string
-                          ;; below, make sure to update the relevant code in
-                          ;; %gcc-static package as needed.
-                          (format #f "#define GNU_USER_TARGET_LIB_SPEC \
+                         (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
+                          line)))
+                     '(1 2 3))
+
+                    ;; Fix the dynamic linker's file name.
+                    (substitute* (find-files "gcc/config"
+                                             "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
+                      (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
+                        _ gnu-user suffix)
+                       (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
+                               gnu-user suffix
+                               (string-append libc ,(glibc-dynamic-linker)))))
+
+                    ;; Tell where to find libstdc++, libc, and `?crt*.o', except
+                    ;; `crt{begin,end}.o', which come with GCC.
+                    (substitute* (find-files "gcc/config"
+                                             "^gnu-user.*\\.h$")
+                      (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
+                       ;; Help libgcc_s.so be found (see also below.)  Always use
+                       ;; '-lgcc_s' so that libgcc_s.so is always found by those
+                       ;; programs that use 'pthread_cancel' (glibc dlopens
+                       ;; libgcc_s.so when pthread_cancel support is needed, but
+                       ;; having it in the application's RUNPATH isn't enough; see
+                       ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
+                       ;;
+                       ;; NOTE: The '-lgcc_s' added below needs to be removed in a
+                       ;; later phase of %gcc-static.  If you change the string
+                       ;; below, make sure to update the relevant code in
+                       ;; %gcc-static package as needed.
+                       (format #f "#define GNU_USER_TARGET_LIB_SPEC \
 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
-                                  libc libc libdir suffix))
-                         (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
-                          (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
+                               libc libc libdir suffix))
+                      (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
+                       (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
 #define STANDARD_STARTFILE_PREFIX_2 \"\"
 ~a"
-                                  libc line)))
-
-                       ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
-                       ;; GNU_USER_* defines.  Do the above for this case.
-                       (substitute*
-                           "gcc/config/rs6000/sysv4.h"
-                         (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
-                          (format #f "#define LIB_LINUX_SPEC \
+                               libc line)))
+
+                    ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
+                    ;; GNU_USER_* defines.  Do the above for this case.
+                    (substitute*
+                        "gcc/config/rs6000/sysv4.h"
+                      (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
+                       (format #f "#define LIB_LINUX_SPEC \
 \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
-                                  libc libc libdir suffix))
-                         (("#define    STARTFILE_LINUX_SPEC.*$" line)
-                          (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
+                               libc libc libdir suffix))
+                      (("#define       STARTFILE_LINUX_SPEC.*$" line)
+                       (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
 #define STANDARD_STARTFILE_PREFIX_2 \"\"
 ~a"
-                                  libc line))))
-
-                 ;; Don't retain a dependency on the build-time sed.
-                 (substitute* "fixincludes/fixincl.x"
-                   (("static char const sed_cmd_z\\[\\] =.*;")
-                    "static char const sed_cmd_z[] = \"sed\";"))
-
-                 ;; Aarch64 support didn't land in GCC until the 4.8 series.
-                 (when (file-exists? "gcc/config/aarch64")
-                       ;; Force Aarch64 libdir to be /lib and not /lib64
-                       (substitute* "gcc/config/aarch64/t-aarch64-linux"
-                         (("lib64") "lib")))
-
-                 (when (file-exists? "libbacktrace")
-                       ;; GCC 4.8+ comes with libbacktrace.  By default it builds
-                       ;; with -Werror, which fails with a -Wcast-qual error in glibc
-                       ;; 2.21's stdlib-bsearch.h.  Remove -Werror.
-                       (substitute* "libbacktrace/configure"
-                         (("WARN_FLAGS=(.*)-Werror" _ flags)
-                          (string-append "WARN_FLAGS=" flags)))
-
-                       (when (file-exists? "libsanitizer/libbacktrace")
-                             ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
-                             (substitute* "libsanitizer/libbacktrace/Makefile.in"
-                               (("-Werror")
-                                ""))))
-
-                 ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
-                 ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
-                 ;; and <http://bugs.gnu.org/20358>.
-                 (substitute* "libstdc++-v3/src/Makefile.in"
-                   (("^OPT_LDFLAGS = ")
-                    "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
-
-                 ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
-                 ;; circularity between "out" and "lib".  (Note:
-                 ;; --with-python-dir is useless because it imposes $(prefix) as
-                 ;; the parent directory.)
-                 (substitute* "libstdc++-v3/python/Makefile.in"
-                   (("pythondir = .*$")
-                    (string-append "pythondir = " libdir "/share"
-                                   "/gcc-$(gcc_version)/python\n")))
-
-                 ;; Avoid another circularity between the outputs: this #define
-                 ;; ends up in auto-host.h in the "lib" output, referring to
-                 ;; "out".  (This variable is used to augment cpp's search path,
-                 ;; but there's nothing useful to look for here.)
-                 (substitute* "gcc/config.in"
-                   (("PREFIX_INCLUDE_DIR")
-                    "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
-                 #t)))
-
-           (add-after 'configure 'post-configure
-             (lambda _
-               ;; Don't store configure flags, to avoid retaining references to
-               ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
-               (substitute* "Makefile"
-                 (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
-                  "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
-               #t)))))
-
-      (native-search-paths
-       ;; Use the language-specific variables rather than 'CPATH' because they
-       ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
-       ;; The intent is to allow headers that are in the search path to be
-       ;; treated as "system headers" (headers exempt from warnings) just like
-       ;; the typical /usr/include headers on an FHS system.
-       (list (search-path-specification
-              (variable "C_INCLUDE_PATH")
-              (files '("include")))
-             (search-path-specification
-              (variable "CPLUS_INCLUDE_PATH")
-              (files '("include")))
-             (search-path-specification
-              (variable "LIBRARY_PATH")
-              (files '("lib" "lib64")))))
-
-      (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
-      (synopsis "GNU Compiler Collection")
-      (description
-       "GCC is the GNU Compiler Collection.  It provides compiler front-ends
+                               libc line))))
+
+                  ;; Don't retain a dependency on the build-time sed.
+                  (substitute* "fixincludes/fixincl.x"
+                    (("static char const sed_cmd_z\\[\\] =.*;")
+                     "static char const sed_cmd_z[] = \"sed\";"))
+
+                  ;; Aarch64 support didn't land in GCC until the 4.8 series.
+                  (when (file-exists? "gcc/config/aarch64")
+                    ;; Force Aarch64 libdir to be /lib and not /lib64
+                    (substitute* "gcc/config/aarch64/t-aarch64-linux"
+                      (("lib64") "lib")))
+
+                  (when (file-exists? "libbacktrace")
+                    ;; GCC 4.8+ comes with libbacktrace.  By default it builds
+                    ;; with -Werror, which fails with a -Wcast-qual error in glibc
+                    ;; 2.21's stdlib-bsearch.h.  Remove -Werror.
+                    (substitute* "libbacktrace/configure"
+                      (("WARN_FLAGS=(.*)-Werror" _ flags)
+                       (string-append "WARN_FLAGS=" flags)))
+
+                    (when (file-exists? "libsanitizer/libbacktrace")
+                      ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
+                      (substitute* "libsanitizer/libbacktrace/Makefile.in"
+                        (("-Werror")
+                         ""))))
+
+                  ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
+                  ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
+                  ;; and <http://bugs.gnu.org/20358>.
+                  (substitute* "libstdc++-v3/src/Makefile.in"
+                    (("^OPT_LDFLAGS = ")
+                     "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
+
+                  ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
+                  ;; circularity between "out" and "lib".  (Note:
+                  ;; --with-python-dir is useless because it imposes $(prefix) as
+                  ;; the parent directory.)
+                  (substitute* "libstdc++-v3/python/Makefile.in"
+                    (("pythondir = .*$")
+                     (string-append "pythondir = " libdir "/share"
+                                    "/gcc-$(gcc_version)/python\n")))
+
+                  ;; Avoid another circularity between the outputs: this #define
+                  ;; ends up in auto-host.h in the "lib" output, referring to
+                  ;; "out".  (This variable is used to augment cpp's search path,
+                  ;; but there's nothing useful to look for here.)
+                  (substitute* "gcc/config.in"
+                    (("PREFIX_INCLUDE_DIR")
+                     "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
+                  #t)))
+
+            (add-after 'configure 'post-configure
+              (lambda _
+                ;; Don't store configure flags, to avoid retaining references to
+                ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
+                (substitute* "Makefile"
+                  (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
+                   "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
+                #t)))))
+
+       (native-search-paths
+        ;; Use the language-specific variables rather than 'CPATH' because they
+        ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
+        ;; The intent is to allow headers that are in the search path to be
+        ;; treated as "system headers" (headers exempt from warnings) just like
+        ;; the typical /usr/include headers on an FHS system.
+        (list (search-path-specification
+               (variable "C_INCLUDE_PATH")
+               (files '("include")))
+              (search-path-specification
+               (variable "CPLUS_INCLUDE_PATH")
+               ;; Add 'include/c++' here so that <cstdlib>'s "#include_next
+               ;; <stdlib.h>" finds GCC's <stdlib.h>, not libc's.
+               (files '("include/c++" "include")))
+              (search-path-specification
+               (variable "LIBRARY_PATH")
+               (files '("lib" "lib64")))))
+
+       (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
+       (synopsis "GNU Compiler Collection")
+       (description
+        "GCC is the GNU Compiler Collection.  It provides compiler front-ends
 for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
 Go.  It also includes runtime support libraries for these languages.")
-      (license gpl3+)
-      (supported-systems (delete "aarch64-linux" %supported-systems))
-      (home-page "https://gcc.gnu.org/"))))
+       (license gpl3+)
+       (supported-systems (delete "aarch64-linux" %supported-systems))
+       (home-page "https://gcc.gnu.org/")))))
 
 (define-public gcc-4.8
   (package (inherit gcc-4.7)
@@ -399,6 +404,7 @@ Go.  It also includes runtime support libraries for these languages.")
                 "14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
               (patches (search-patches "gcc-4.9-libsanitizer-fix.patch"
                                        "gcc-4.9-libsanitizer-ustat.patch"
+                                       "gcc-4.9-libsanitizer-mode-size.patch"
                                        "gcc-arm-bug-71399.patch"
                                        "gcc-asan-missing-include.patch"
                                        "gcc-libvtv-runpath.patch"
@@ -418,7 +424,33 @@ Go.  It also includes runtime support libraries for these languages.")
                   #t))))
     ;; Override inherited texinfo-5 with latest version.
     (native-inputs `(("perl" ,perl)   ;for manpages
-                     ("texinfo" ,texinfo)))))
+                     ("texinfo" ,texinfo)))
+    (arguments
+     (if (%current-target-system)
+         (package-arguments gcc-4.8)
+         ;; For native builds of GCC 4.9 and GCC 5, the C++ include path needs
+         ;; to be adjusted so it does not interfere with GCC's own build processes.
+         (substitute-keyword-arguments (package-arguments gcc-4.8)
+           ((#:modules modules %gnu-build-system-modules)
+            `((srfi srfi-1)
+              ,@modules))
+           ((#:phases phases)
+            `(modify-phases ,phases
+               (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((libc (assoc-ref inputs "libc"))
+                         (gcc (assoc-ref inputs  "gcc")))
+                     (setenv "CPLUS_INCLUDE_PATH"
+                             (string-join (fold delete
+                                                (string-split (getenv "CPLUS_INCLUDE_PATH")
+                                                              #\:)
+                                                (list (string-append libc "/include")
+                                                      (string-append gcc "/include/c++")))
+                                          ":"))
+                     (format #t
+                             "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+                             (getenv "CPLUS_INCLUDE_PATH"))
+                     #t))))))))))
 
 (define-public gcc-5
   ;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
@@ -438,7 +470,9 @@ Go.  It also includes runtime support libraries for these languages.")
                                        "gcc-5.0-libvtv-runpath.patch"
                                        "gcc-5-source-date-epoch-1.patch"
                                        "gcc-5-source-date-epoch-2.patch"
-                                       "gcc-fix-texi2pod.patch"))
+                                       "gcc-6-libsanitizer-mode-size.patch"
+                                       "gcc-fix-texi2pod.patch"
+                                       "gcc-5-hurd.patch"))
               (modules '((guix build utils)))
               (snippet
                ;; Fix 'libcc1/configure' error when cross-compiling GCC.
@@ -470,35 +504,37 @@ Go.  It also includes runtime support libraries for these languages.")
                (base32
                 "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby"))
               (patches (search-patches "gcc-strmov-store-file-names.patch"
+                                       "gcc-6-libsanitizer-mode-size.patch"
                                        "gcc-6-source-date-epoch-1.patch"
                                        "gcc-6-source-date-epoch-2.patch"
                                        "gcc-5.0-libvtv-runpath.patch"))))
+
+    ;; GCC 4.9 and 5 has a workaround that is not needed for GCC 6 and later.
+    (arguments (package-arguments gcc-4.8))
+
     (inputs
      `(("isl" ,isl)
-       ,@(package-inputs gcc-4.7)))
-
-    (native-search-paths
-     ;; We have to use 'CPATH' for GCC > 5, not 'C_INCLUDE_PATH' & co., due to
-     ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129>.
-     (list (search-path-specification
-            (variable "CPATH")
-            (files '("include")))
-           (search-path-specification
-            (variable "LIBRARY_PATH")
-            (files '("lib" "lib64")))))))
+
+       ;; 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
   (package
     (inherit gcc-6)
-    (version "7.4.0")
+    (version "7.5.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnu/gcc/gcc-"
                                   version "/gcc-" version ".tar.xz"))
               (sha256
                (base32
-                "0lgy170b0pp60j9cczqkmaqyjjb584vfamj4c30swd7k0j6y5pgd"))
+                "0qg6kqc5l72hpnj4vr6l0p69qav0rh4anlkk3y55540zy3klc6dq"))
               (patches (search-patches "gcc-strmov-store-file-names.patch"
+                                       "gcc-7-libsanitizer-mode-size.patch"
                                        "gcc-5.0-libvtv-runpath.patch"))))
     (description
      "GCC is the GNU Compiler Collection.  It provides compiler front-ends
@@ -508,36 +544,50 @@ It also includes runtime support libraries for these languages.")))
 (define-public gcc-8
   (package
     (inherit gcc-7)
-    (version "8.3.0")
+    (version "8.4.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnu/gcc/gcc-"
                                   version "/gcc-" version ".tar.xz"))
               (sha256
                (base32
-                "0b3xv411xhlnjmin2979nxcbnidgvzqdf4nbhix99x60dkzavfk4"))
+                "1m1d3gfix56w4aq8myazzfffkl8bqcrx4jhhapnjf7qfs596w2p3"))
               (patches (search-patches "gcc-8-strmov-store-file-names.patch"
                                        "gcc-5.0-libvtv-runpath.patch"))))))
 
 (define-public gcc-9
   (package
    (inherit gcc-8)
-   (version "9.1.0")
+   (version "9.3.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/gcc/gcc-"
                                 version "/gcc-" version ".tar.xz"))
             (sha256
              (base32
-              "1817nc2bqdc251k0lpc51cimna7v68xjrnvqzvc50q3ax4s6i9kr"))
+              "1la2yy27ziasyf0jvzk58y1i5b5bq2h176qil550bxhifs39gqbi"))
             (patches (search-patches "gcc-9-strmov-store-file-names.patch"
                                      "gcc-9-asan-fix-limits-include.patch"
                                      "gcc-5.0-libvtv-runpath.patch"))))))
 
+(define-public gcc-10
+  (package
+   (inherit gcc-8)
+   (version "10.2.0")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "mirror://gnu/gcc/gcc-"
+                                version "/gcc-" version ".tar.xz"))
+            (sha256
+             (base32
+              "130xdkhmz1bc2kzx061s3sfwk36xah1fw5w332c0nzwwpdl47pdq"))
+            (patches (search-patches "gcc-9-strmov-store-file-names.patch"
+                                     "gcc-5.0-libvtv-runpath.patch"))))))
+
 ;; Note: When changing the default gcc version, update
 ;;       the gcc-toolchain-* definitions and the gfortran definition
 ;;       accordingly.
-(define-public gcc gcc-5)
+(define-public gcc gcc-7)
 
 (define-public (make-libstdc++ gcc)
   "Return a libstdc++ package based on GCC.  The primary use case is when
@@ -563,6 +613,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))
 
@@ -576,26 +651,22 @@ using compilers other than GCC."
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'chdir
-                     (lambda _
-                       (chdir "libiberty")
-                       #t))
-         (replace
-          'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let* ((out     (assoc-ref outputs "out"))
-                   (lib     (string-append out "/lib/"))
-                   (include (string-append out "/include/")))
-              (mkdir-p lib)
-              (mkdir-p include)
-              (copy-file "libiberty.a"
-                         (string-append lib "libiberty.a"))
-              (copy-file "../include/libiberty.h"
-                         (string-append include "libiberty.h"))
-              #t))))))
+           (lambda _
+             (chdir "libiberty")
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out     (assoc-ref outputs "out"))
+                    (lib     (string-append out "/lib/"))
+                    (include (string-append out "/include/")))
+               (install-file "libiberty.a" lib)
+               (install-file "../include/libiberty.h" include))
+             #t)))))
     (inputs '())
     (outputs '("out"))
     (native-inputs '())
     (propagated-inputs '())
+    (properties '())
     (synopsis "Collection of subroutines used by various GNU programs")))
 
 (define-public libiberty
@@ -613,13 +684,14 @@ as the 'native-search-paths' field."
                  (package-outputs gcc)
                  (delete "lib" (package-outputs gcc))))
     (native-search-paths search-paths)
+    (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 modules %gnu-build-system-modules)
+        `(,@modules
+          (srfi srfi-1)
+          (srfi srfi-26)
+          (ice-9 regex)))
        ((#:configure-flags flags)
         `(cons (string-append "--enable-languages="
                               ,(string-join languages ","))
@@ -646,36 +718,49 @@ as the 'native-search-paths' field."
          (variable "LIBRARY_PATH")
          (files '("lib" "lib64")))))
 
-(define-public gfortran-4.8
-  (custom-gcc gcc-4.8 "gfortran" '("fortran")
-              %generic-search-paths))
-
-(define-public gfortran-4.9
-  (custom-gcc gcc-4.9 "gfortran" '("fortran")
-              %generic-search-paths))
-
-(define-public gfortran-5
-  (custom-gcc gcc-5 "gfortran" '("fortran")
-              %generic-search-paths))
-
-(define-public gfortran-6
-  (custom-gcc gcc-6 "gfortran" '("fortran")
-              %generic-search-paths))
-
-(define-public gfortran-7
-  (custom-gcc gcc-7 "gfortran" '("fortran")
-              %generic-search-paths))
-
-(define-public gfortran-8
-  (custom-gcc gcc-8 "gfortran" '("fortran")
-              %generic-search-paths))
-
 (define-public gfortran
-  ;; Note: Update this when GCC changes!  We cannot use
-  ;; (custom-gcc gcc "fortran" …) because that would lead to a package object
-  ;; that is not 'eq?' with GFORTRAN-5, and thus 'fold-packages' would
-  ;; report two gfortran@5 that are in fact identical.
-  gfortran-5)
+  (hidden-package
+   (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
+  (hidden-package
+   (custom-gcc gcc-10 "gdc" '("d")
+               %generic-search-paths)))
+
+(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")
@@ -685,117 +770,89 @@ as the 'native-search-paths' field."
               ;; a cyclic dependency.  <http://debbugs.gnu.org/18101>
               #:separate-lib-output? #f))
 
+(define %objc-search-paths
+  (list (search-path-specification
+         (variable "OBJC_INCLUDE_PATH")
+         (files '("include")))
+        (search-path-specification
+         (variable "LIBRARY_PATH")
+         (files '("lib" "lib64")))))
+
 (define-public gcc-objc-4.8
   (custom-gcc gcc-4.8 "gcc-objc" '("objc")
-              (list (search-path-specification
-                     (variable "OBJC_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc-search-paths))
 
 (define-public gcc-objc-4.9
   (custom-gcc gcc-4.9 "gcc-objc" '("objc")
-              (list (search-path-specification
-                     (variable "OBJC_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc-search-paths))
 
 (define-public gcc-objc-5
   (custom-gcc gcc-5 "gcc-objc" '("objc")
-              (list (search-path-specification
-                     (variable "OBJC_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc-search-paths))
 
 (define-public gcc-objc-6
   (custom-gcc gcc-6 "gcc-objc" '("objc")
-              (list (search-path-specification
-                     (variable "OBJC_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc-search-paths))
 
 (define-public gcc-objc-7
   (custom-gcc gcc-7 "gcc-objc" '("objc")
-              (list (search-path-specification
-                     (variable "OBJC_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc-search-paths))
 
 (define-public gcc-objc-8
   (custom-gcc gcc-8 "gcc-objc" '("objc")
-              (list (search-path-specification
-                     (variable "OBJC_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc-search-paths))
+
+(define-public gcc-objc-9
+  (custom-gcc gcc-9 "gcc-objc" '("objc")
+              %objc-search-paths))
 
-(define-public gcc-objc gcc-objc-5)
+(define-public gcc-objc-10
+  (custom-gcc gcc-10 "gcc-objc" '("objc")
+              %objc-search-paths))
+
+(define-public gcc-objc gcc-objc-7)
+
+(define %objc++-search-paths
+  (list (search-path-specification
+         (variable "OBJCPLUS_INCLUDE_PATH")
+         (files '("include")))
+        (search-path-specification
+         (variable "LIBRARY_PATH")
+         (files '("lib" "lib64")))))
 
 (define-public gcc-objc++-4.8
   (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
-              (list (search-path-specification
-                     (variable "OBJCPLUS_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc++-search-paths))
 
 (define-public gcc-objc++-4.9
   (custom-gcc gcc-4.9 "gcc-objc++" '("obj-c++")
-              (list (search-path-specification
-                     (variable "OBJCPLUS_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc++-search-paths))
 
 (define-public gcc-objc++-5
   (custom-gcc gcc-5 "gcc-objc++" '("obj-c++")
-              (list (search-path-specification
-                     (variable "OBJCPLUS_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc++-search-paths))
 
 (define-public gcc-objc++-6
   (custom-gcc gcc-6 "gcc-objc++" '("obj-c++")
-              (list (search-path-specification
-                     (variable "OBJCPLUS_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc++-search-paths))
 
 (define-public gcc-objc++-7
   (custom-gcc gcc-7 "gcc-objc++" '("obj-c++")
-              (list (search-path-specification
-                     (variable "OBJCPLUS_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc++-search-paths))
 
 (define-public gcc-objc++-8
   (custom-gcc gcc-8 "gcc-objc++" '("obj-c++")
-              (list (search-path-specification
-                     (variable "OBJCPLUS_INCLUDE_PATH")
-                     (files '("include")))
-                    (search-path-specification
-                     (variable "LIBRARY_PATH")
-                     (files '("lib" "lib64"))))))
+              %objc++-search-paths))
+
+(define-public gcc-objc++-9
+  (custom-gcc gcc-9 "gcc-objc++" '("obj-c++")
+              %objc++-search-paths))
+
+(define-public gcc-objc++-10
+  (custom-gcc gcc-10 "gcc-objc++" '("obj-c++")
+              %objc++-search-paths))
 
-(define-public gcc-objc++ gcc-objc++-5)
+(define-public gcc-objc++ gcc-objc++-7)
 
 (define (make-libstdc++-doc gcc)
   "Return a package with the libstdc++ documentation for GCC."
@@ -846,18 +903,19 @@ as the 'native-search-paths' field."
                              (let ((out (assoc-ref outputs "out")))
                                (invoke "make"
                                        "doc-install-html"
-                                       "doc-install-man")))))))))
-
-(define-public libstdc++-doc-4.9
-  (make-libstdc++-doc gcc-4.9))
+                                       "doc-install-man")))))))
+    (properties (alist-delete 'hidden? (package-properties gcc)))))
 
 (define-public libstdc++-doc-5
   (make-libstdc++-doc gcc-5))
 
+(define-public libstdc++-doc-9
+  (make-libstdc++-doc gcc-9))
+
 (define-public isl
   (package
     (name "isl")
-    (version "0.19")
+    (version "0.22.1")
     (source (origin
              (method url-fetch)
              (uri (list (string-append
@@ -865,11 +923,30 @@ as the 'native-search-paths' field."
                          version
                          ".tar.bz2")
                         (string-append %gcc-infrastructure
-                                       name "-" version ".tar.gz")))
+                                       name "-" version ".tar.bz2")))
              (sha256
               (base32
-               "1n4yz9rj24mv226hqbpw210ifvqkn8dgvpnkzf0s0lkq9zrjd5ym"))))
+               "1kf54jib0nind1pvakblnfhimmwzm0y1llz8470ag0di5vwqwrhs"))))
     (build-system gnu-build-system)
+    (outputs '("out" "static"))
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'install 'move-static-library
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (static (assoc-ref outputs "static"))
+                             (source (string-append out "/lib/libisl.a"))
+                             (target (string-append static "/lib/libisl.a")))
+                        (mkdir-p (dirname target))
+                        (link source target)
+                        (delete-file source)
+
+                        ;; Remove reference to libisl.a from the .la file so
+                        ;; libtool looks for it in the usual locations.
+                        (substitute* (string-append out "/lib/libisl.la")
+                          (("^old_library=.*")
+                           "old_library=''\n"))
+                        #t))))))
     (inputs `(("gmp" ,gmp)))
     (home-page "http://isl.gforge.inria.fr/")
     (synopsis
@@ -895,7 +972,7 @@ dependence analysis and bounds on piecewise step-polynomials.")
               (uri (list (string-append "http://isl.gforge.inria.fr/isl-"
                                         version ".tar.bz2")
                          (string-append %gcc-infrastructure
-                                        "isl-" version ".tar.gz")))
+                                        "isl-" version ".tar.bz2")))
               (sha256
                (base32
                 "06ybml6llhi4i56q90jnimbcgk1lpcdwhy9nxdxra2hxz3bhz2vb"))))))
@@ -912,7 +989,7 @@ dependence analysis and bounds on piecewise step-polynomials.")
                          version
                          ".tar.bz2")
                         (string-append %gcc-infrastructure
-                                       name "-" version ".tar.gz")))
+                                       name "-" version ".tar.bz2")))
              (sha256
               (base32
                "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"))