gnu: gcc@4.9, gcc@5.5: Build with '-std=c++11'.
These two compilers would fail to build with GCC 11.3.0 because it defaults to C++17, which triggers some incompatibilities. * gnu/packages/gcc.scm (gcc-4.7)[arguments]: Augment #:configure-flags for 4.9 and 5.0. (gcc-4.9)[arguments]: Define 'parent' so that (package-arguments parent) correctly evaluates the version-dependent parts.
This commit is contained in:
parent
f073a850c9
commit
0aed5bf512
1 changed files with 40 additions and 25 deletions
|
@ -182,7 +182,16 @@ where the OS part is overloaded to denote a specific ABI---into GCC
|
||||||
|
|
||||||
(arguments
|
(arguments
|
||||||
`(#:out-of-source? #t
|
`(#:out-of-source? #t
|
||||||
#:configure-flags ,(configure-flags)
|
#: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))
|
||||||
|
|
||||||
#:make-flags
|
#:make-flags
|
||||||
;; None of the flags below are needed when doing a Canadian cross.
|
;; None of the flags below are needed when doing a Canadian cross.
|
||||||
;; TODO: Simplify this.
|
;; TODO: Simplify this.
|
||||||
|
@ -439,11 +448,17 @@ Go. It also includes runtime support libraries for these languages.")
|
||||||
(native-inputs (list perl ;for manpages
|
(native-inputs (list perl ;for manpages
|
||||||
texinfo))
|
texinfo))
|
||||||
(arguments
|
(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)
|
(if (%current-target-system)
|
||||||
(package-arguments gcc-4.8)
|
(package-arguments parent)
|
||||||
;; For native builds of GCC 4.9 and GCC 5, the C++ include path needs
|
;; 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.
|
;; to be adjusted so it does not interfere with GCC's own build processes.
|
||||||
(substitute-keyword-arguments (package-arguments gcc-4.8)
|
(substitute-keyword-arguments (package-arguments parent)
|
||||||
((#:modules modules %gnu-build-system-modules)
|
((#:modules modules %gnu-build-system-modules)
|
||||||
`((srfi srfi-1)
|
`((srfi srfi-1)
|
||||||
,@modules))
|
,@modules))
|
||||||
|
@ -462,7 +477,7 @@ Go. It also includes runtime support libraries for these languages.")
|
||||||
":"))
|
":"))
|
||||||
(format #t
|
(format #t
|
||||||
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
|
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
|
||||||
(getenv "CPLUS_INCLUDE_PATH"))))))))))))
|
(getenv "CPLUS_INCLUDE_PATH")))))))))))))
|
||||||
|
|
||||||
(define gcc-canadian-cross-objdump-snippet
|
(define gcc-canadian-cross-objdump-snippet
|
||||||
;; Fix 'libcc1/configure' error when cross-compiling GCC. Without that,
|
;; Fix 'libcc1/configure' error when cross-compiling GCC. Without that,
|
||||||
|
|
Reference in a new issue