[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/10: gnu: Use GCC 7 as the default compiler.

From: guix-commits
Subject: 01/10: gnu: Use GCC 7 as the default compiler.
Date: Wed, 16 Jan 2019 08:41:18 -0500 (EST)

mbakke pushed a commit to branch wip-gcc7
in repository guix.

commit c5c5c95713dd4fa7640de1c52fe25b9067083e05
Author: Marius Bakke <address@hidden>
Date:   Thu Sep 20 19:56:30 2018 +0200

    gnu: Use GCC 7 as the default compiler.
    * gnu/build/cross-toolchain.scm (cross-gcc-build-phases): Set C_INCLUDE_PATH
    and CPLUS_INCLUDE_PATH when building the cross GCC.
    * gnu/packages/commencement.scm (libstdc++): Add
    "--disable-libstdcxx-dual-abi" to #:configure-flags.
    (gcc-boot0)[arguments]: Add "--disable-libmpx"
    to #:configure-flags.
    (gcc-final): Add phase to set C_INCLUDE_PATH and CPLUS_INCLUDE_PATH before
    building GCC.
    (gcc-toolchain-5): Use MAKE-GCC-TOOLCHAIN.
    (gcc-toolchain-7): Change to GCC-TOOLCHAIN.
    * gnu/packages/gcc.scm (gcc): Change from GCC-5 to GCC-7.
    (gfortran): Change to GFORTRAN-7.
    (gcc-objc): Change to GCC-OBJC-7.
    (gcc-objc++): Change to GCC-OBJC++-7.
 gnu/build/cross-toolchain.scm | 10 ++++++++++
 gnu/packages/commencement.scm | 21 ++++++++++++++++-----
 gnu/packages/gcc.scm          |  8 ++++----
 3 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/gnu/build/cross-toolchain.scm b/gnu/build/cross-toolchain.scm
index d430b8a..cd41acf 100644
--- a/gnu/build/cross-toolchain.scm
+++ b/gnu/build/cross-toolchain.scm
@@ -171,6 +171,16 @@ a target triplet."
       (if (string-contains target "mingw")
+    (add-before 'configure 'treat-glibc-as-system-header
+      (lambda* (#:key inputs #:allow-other-keys)
+        (let ((libc (assoc-ref inputs "libc")))
+          (when libc
+            ;; For GCC6 and later, make sure Glibc is treated as a "system
+            ;; header" such that #include_next does the right thing.
+            (for-each (lambda (var)
+                        (setenv var (string-append libc "/include")))
+                      '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH")))
+          #t)))
     (add-after 'install 'make-cross-binutils-visible
       (cut make-cross-binutils-visible #:target target <...>))
     (replace 'install install-strip)))
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 79246a0..ab05ecc 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1578,6 +1578,7 @@ exec " gcc "/bin/" program
+                            "--disable-libmpx"
@@ -2118,6 +2119,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a 
          ;; except for the configure-flags.
          ,@(package-arguments lib)
          #:configure-flags `("--disable-shared"
+                             "--disable-libstdcxx-dual-abi"
                              ,(string-append "--with-gxx-include-dir="
@@ -2207,6 +2209,15 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a 
                                          ,(package-name lib)))
                              (list gmp-6.0 mpfr mpc))
+                      #t)))
+                (add-before 'configure 'treat-glibc-as-system-header
+                  (lambda* (#:key inputs #:allow-other-keys)
+                    (let ((libc (assoc-ref inputs "libc")))
+                      ;; Make sure Glibc is treated as a "system header" so
+                      ;; #include_next does the right thing.
+                      (for-each (lambda (var)
+                                  (setenv var (string-append libc "/include")))
+                                '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"))
     ;; This time we want Texinfo, so we get the manual.  Add
@@ -2455,23 +2466,23 @@ and binaries, plus debugging symbols in the 'debug' 
output), and Binutils.")
               ("libc-debug" ,glibc-final "debug")
               ("libc-static" ,glibc-final "static")))))
+(define-public gcc-toolchain
+  (make-gcc-toolchain gcc-final))
 (define-public gcc-toolchain-4.8
   (make-gcc-toolchain gcc-4.8))
 (define-public gcc-toolchain-4.9
   (make-gcc-toolchain gcc-4.9))
-(define-public gcc-toolchain
-  (make-gcc-toolchain gcc-final))
 (define-public gcc-toolchain-5
-  gcc-toolchain)
+  (make-gcc-toolchain gcc-5))
 (define-public gcc-toolchain-6
   (make-gcc-toolchain gcc-6))
 (define-public gcc-toolchain-7
-  (make-gcc-toolchain gcc-7))
+  gcc-toolchain)
 (define-public gcc-toolchain-8
   (make-gcc-toolchain gcc-8))
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 1f1e80d..3b6c540 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -522,7 +522,7 @@ It also includes runtime support libraries for these 
 ;; 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
@@ -660,7 +660,7 @@ as the 'native-search-paths' field."
   ;; (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 address@hidden that are in fact identical.
-  gfortran-5)
+  gfortran-7)
 (define-public gccgo-4.9
   (custom-gcc gcc-4.9 "gccgo" '("go")
@@ -724,7 +724,7 @@ as the 'native-search-paths' field."
                      (variable "LIBRARY_PATH")
                      (files '("lib" "lib64"))))))
-(define-public gcc-objc gcc-objc-5)
+(define-public gcc-objc gcc-objc-7)
 (define-public gcc-objc++-4.8
   (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")
@@ -780,7 +780,7 @@ as the 'native-search-paths' field."
                      (variable "LIBRARY_PATH")
                      (files '("lib" "lib64"))))))
-(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."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]