guix-commits
[Top][All Lists]
Advanced

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

branch master updated: gnu: gcc-4.8: Fix building.


From: guix-commits
Subject: branch master updated: gnu: gcc-4.8: Fix building.
Date: Tue, 13 Feb 2024 13:59:13 -0500

This is an automated email from the git hooks/post-receive script.

efraim pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 50d068591c gnu: gcc-4.8: Fix building.
50d068591c is described below

commit 50d068591cb667d8fe0b883ab6ada368a694ffc1
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Tue Feb 13 20:42:36 2024 +0200

    gnu: gcc-4.8: Fix building.
    
    * gnu/packages/gcc.scm (gcc-4.7)[arguments]: Adjust configure-flags to
    build gcc-4.8 using the C++03 standard.
    (gcc-4.8)[arguments]: Add a phase to remove the current gcc's C++
    headers from the CPLUS_INCLUDE_PATH.
    (gcc-4.9)[arguments]: Inherit from gcc-4.8.
    (gcc-6)[arguments]: Inherit from gcc-4.7.
    
    Change-Id: Ibec0683e8385ae011e6a809c664cb679f1a35b80
---
 gnu/packages/gcc.scm | 83 +++++++++++++++++++++++++++-------------------------
 1 file changed, 43 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 5344278174..ff830f8b35 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -192,13 +192,16 @@ where the OS part is overloaded to denote a specific 
ABI---into GCC
         `(#:out-of-source? #t
           #:configure-flags ,(let ((flags (configure-flags))
                                    (version (package-version this-package)))
-                               ;; GCC 4.9 and 5.0 requires C++11 but GCC
-                               ;; 11.3.0 defaults to C++17, which is partly
-                               ;; incompatible.  Force C++11.
-                               (if (or (version-prefix? "4.9" version)
-                                       (version-prefix? "5" version))
-                                   `(cons "CXX=g++ -std=c++11" ,flags)
-                                   flags))
+                               ;; GCC 11.3.0 defaults to C++17 which is partly
+                               ;; incompatible with some earlier versions.
+                               ;; Force an earlier C++ standard while building.
+                               (cond
+                                 ((version-prefix? "4.8" version)
+                                  `(cons "CXX=g++ -std=c++03" ,flags))
+                                 ((or (version-prefix? "4.9" version)
+                                      (version-prefix? "5" version))
+                                  `(cons "CXX=g++ -std=c++11" ,flags))
+                                 (else flags)))
 
           #:make-flags
           ;; None of the flags below are needed when doing a Canadian cross.
@@ -419,6 +422,37 @@ Go.  It also includes runtime support libraries for these 
languages.")
                      (("struct ucontext") "ucontext_t")))
                  '("aarch64" "alpha" "bfin" "i386" "m68k"
                    "pa" "sh" "tilepro" "xtensa")))))
+    (arguments
+     ;; Since 'arguments' is a function of the package's version, define
+     ;; 'parent' such that the 'arguments' thunk gets to see the right
+     ;; version.
+     (let ((parent (package
+                     (inherit gcc-4.7)
+                     (version (package-version this-package)))))
+       (if (%current-target-system)
+           (package-arguments parent)
+           ;; For native builds of some GCC versions the C++ include path 
needs to
+           ;; be adjusted so it does not interfere with GCC's own build 
processes.
+           (substitute-keyword-arguments (package-arguments parent)
+             ((#: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")))))))))))
     (supported-systems %supported-systems)
     (inputs
      (modify-inputs (package-inputs gcc-4.7)
@@ -454,38 +488,7 @@ Go.  It also includes runtime support libraries for these 
languages.")
                    "pa" "sh" "tilepro" "xtensa")))))
     ;; Override inherited texinfo-5 with latest version.
     (native-inputs (list perl ;for manpages
-                         texinfo))
-    (arguments
-     ;; Since 'arguments' is a function of the package's version, define
-     ;; 'parent' such that the 'arguments' thunk gets to see the right
-     ;; version.
-     (let ((parent (package
-                     (inherit gcc-4.8)
-                     (version (package-version this-package)))))
-       (if (%current-target-system)
-           (package-arguments parent)
-           ;; 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 parent)
-             ((#: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")))))))))))))
+                         texinfo))))
 
 (define gcc-canadian-cross-objdump-snippet
   ;; Fix 'libcc1/configure' error when cross-compiling GCC.  Without that,
@@ -546,7 +549,7 @@ Go.  It also includes runtime support libraries for these 
languages.")
                                        "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))
+    (arguments (package-arguments gcc-4.7))
 
     (inputs
      `(("isl" ,isl)



reply via email to

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