gnu: gcc@4.9: Fix building with glibc@2.26.

* gnu/packages/gcc.scm (gcc@4.9)[source]: Add snippet to adjust
linux-unwind.h to changes in glibc.
* gnu/packages/commencement.scm (gcc-for-libstdc++): New variable.
(libstdc++-boot0): Inherit from gcc-for-libstdc++, update note.
This commit is contained in:
Efraim Flashner 2018-01-17 22:08:01 +02:00
parent 491f7fc023
commit 809b0a9044
No known key found for this signature in database
GPG Key ID: 41AAE7DCCA3D8351
2 changed files with 32 additions and 5 deletions

View File

@ -3,7 +3,7 @@
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
@ -173,12 +173,28 @@
,cf)))))
(inputs %boot0-inputs))))
;; gcc-4.9 was fixed late in the core-update cycle and so this GCC is only
;; needed to prevent a full world rebuild, and can be replaced with gcc-4.9.
(define gcc-for-libstdc++
(package (inherit gcc-4.9)
(version "4.9.4")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/gcc/gcc-"
version "/gcc-" version ".tar.bz2"))
(sha256
(base32
"14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
(patches (search-patches "gcc-arm-bug-71399.patch"
"gcc-libvtv-runpath.patch"
"gcc-fix-texi2pod.patch"))))))
(define libstdc++-boot0
;; GCC's libcc1 is always built as a shared library (the top-level
;; 'Makefile.def' forcefully adds --enable-shared) and thus needs to refer
;; to libstdc++.so. We cannot build libstdc++-5.3 because it relies on
;; C++14 features missing in our bootstrap compiler.
(let ((lib (package-with-bootstrap-guile (make-libstdc++ gcc-4.9))))
;; C++14 features missing in some of our bootstrap compilers.
(let ((lib (package-with-bootstrap-guile (make-libstdc++ gcc-for-libstdc++))))
(package
(inherit lib)
(name "libstdc++-boot0")

View File

@ -3,7 +3,7 @@
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
;;;
;;; This file is part of GNU Guix.
@ -394,7 +394,18 @@ Go. It also includes runtime support libraries for these languages.")
"14l06m7nvcvb0igkbip58x59w3nq6315k6jcz3wr9ch1rn9d44bc"))
(patches (search-patches "gcc-arm-bug-71399.patch"
"gcc-libvtv-runpath.patch"
"gcc-fix-texi2pod.patch"))))
"gcc-fix-texi2pod.patch"))
(modules '((guix build utils)))
;; This is required for building with glibc-2.26.
;; https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
(snippet
'(for-each
(lambda (dir)
(substitute* (string-append "libgcc/config/"
dir "/linux-unwind.h")
(("struct ucontext") "ucontext_t")))
'("aarch64" "alpha" "bfin" "i386" "m68k" "nios2"
"pa" "sh" "tilepro" "xtensa")))))
;; Override inherited texinfo-5 with latest version.
(native-inputs `(("perl" ,perl) ;for manpages
("texinfo" ,texinfo)))))