me
/
guix
Archived
1
0
Fork 0

gnu: gcc-arm-none-eabi: Fix conflicting GCC headers.

Fixes <https://bugs.gnu.org/41210>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* gnu/packages/embedded.scm (gcc-arm-none-eabi-4.9)[arguments]: Add phase to
remove the default compiler from CPLUS_INCLUDE_PATH.
[native-inputs]: Distinguish GCC-5.
master
Marius Bakke 2020-05-13 20:39:01 +02:00
parent fd96ae4a70
commit 7f6d3f3950
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,7 @@
;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -87,12 +88,27 @@
(origin-patches (package-source xgcc)))))) (origin-patches (package-source xgcc))))))
(native-inputs (native-inputs
`(("flex" ,flex) `(("flex" ,flex)
("gcc" ,gcc-5) ("gcc@5" ,gcc-5)
,@(package-native-inputs xgcc))) ,@(package-native-inputs xgcc)))
(arguments (arguments
(substitute-keyword-arguments (package-arguments xgcc) (substitute-keyword-arguments (package-arguments xgcc)
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases `(modify-phases ,phases
(add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
(lambda* (#:key inputs #:allow-other-keys)
(let ((gcc (assoc-ref inputs "gcc")))
;; Remove the default compiler from CPLUS_INCLUDE_PATH to
;; prevent header conflict with the GCC from native-inputs.
(setenv "CPLUS_INCLUDE_PATH"
(string-join
(delete (string-append gcc "/include/c++")
(string-split (getenv "CPLUS_INCLUDE_PATH")
#\:))
":"))
(format #t
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
(getenv "CPLUS_INCLUDE_PATH"))
#t)))
(add-after 'unpack 'fix-genmultilib (add-after 'unpack 'fix-genmultilib
(lambda _ (lambda _
(substitute* "gcc/genmultilib" (substitute* "gcc/genmultilib"