Subject: [WIP PATCH 1/2] gnu: Use GCC 9 as the default compiler.

From: Jakub Kądziołka <[email-masked]>
Date: Wed, 4 Nov 2020 14:34:27 +0100

* gnu/packages/commencement.scm
(gcc-toolchain-7): Use MAKE-GCC-TOOLCHAIN.
(gcc-toolchain-9): Change to GCC-TOOLCHAIN.
* gnu/packages/gcc (gcc): Change from GCC-7 to GCC-9.
(gcc-objc): Change to GCC-OBJC-9.
(gcc-objc++): Change to GCC-OBJC++-9.
---

Dear Guix,

this short patchstack switches the default toolchain to GCC 9 and fixes
enough to get hello to compile.

If my memory is correct, one of the cross-compiling target still breaks.
I'm not interested in trying to figure out why, so I'm sending the WIP
patches your way.

Regards,
Jakub Kądziołka

 gnu/packages/commencement.scm |  4 ++--
 gnu/packages/gcc.scm          | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 1e1c370aa8..6347dd2e1d 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3868,13 +3868,13 @@ is the GNU Compiler Collection.")
   (make-gcc-toolchain gcc-6))
 
 (define-public gcc-toolchain-7
-  gcc-toolchain)
+  (make-gcc-toolchain gcc-7))
 
 (define-public gcc-toolchain-8
   (make-gcc-toolchain gcc-8))
 
 (define-public gcc-toolchain-9
-  (make-gcc-toolchain gcc-9))
+  gcc-toolchain)
 
 (define-public gcc-toolchain-10
   (make-gcc-toolchain gcc-10))
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 4d5aaa7070..ea576dfb8d 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2020 Joseph LaFreniere <[email-masked]>
 ;;; Copyright © 2020 Guy Fleury Iteriteka <[email-masked]>
 ;;; Copyright © 2020 Simon Tournier <[email-masked]>
+;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -585,10 +586,9 @@ It also includes runtime support libraries for these languages.")))
             (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-7)
+;; Note: When changing the default gcc version, update the definitions
+;;       for gcc-toolchain-{old,new}, gcc-objc and gcc-objc++.
+(define-public gcc gcc-9)
 
 (define-public (make-libstdc++ gcc)
   "Return a libstdc++ package based on GCC.  The primary use case is when
@@ -826,7 +826,7 @@ provides the GNU compiler for the Go programming language."))
   (custom-gcc gcc-10 "gcc-objc" '("objc")
               %objc-search-paths))
 
-(define-public gcc-objc gcc-objc-7)
+(define-public gcc-objc gcc-objc-9)
 
 (define %objc++-search-paths
   (list (search-path-specification
@@ -868,7 +868,7 @@ provides the GNU compiler for the Go programming language."))
   (custom-gcc gcc-10 "gcc-objc++" '("obj-c++")
               %objc++-search-paths))
 
-(define-public gcc-objc++ gcc-objc++-7)
+(define-public gcc-objc++ gcc-objc++-9)
 
 (define (make-libstdc++-doc gcc)
   "Return a package with the libstdc++ documentation for GCC."
-- 
2.29.1