summaryrefslogtreecommitdiff
path: root/gnu/packages/embedded.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/embedded.scm')
-rw-r--r--gnu/packages/embedded.scm38
1 files changed, 35 insertions, 3 deletions
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 131a928d80..6ac1a2d7f3 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -5,6 +5,8 @@
;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -87,12 +89,27 @@
(origin-patches (package-source xgcc))))))
(native-inputs
`(("flex" ,flex)
- ("gcc" ,gcc-5)
+ ("gcc@5" ,gcc-5)
,@(package-native-inputs xgcc)))
(arguments
(substitute-keyword-arguments (package-arguments xgcc)
((#: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
(lambda _
(substitute* "gcc/genmultilib"
@@ -234,7 +251,7 @@ usable on embedded products.")
(origin-patches (package-source gcc-7))
(search-patches "gcc-7-cross-environment-variables.patch")))))
(native-inputs
- `(("gcc" ,gcc-5)
+ `(("gcc@5" ,gcc-5)
("flex" ,flex)
("isl" ,isl-0.18)
,@(alist-delete "isl" (package-native-inputs xgcc))))
@@ -253,7 +270,22 @@ usable on embedded products.")
(lambda _
(substitute* "gcc/genmultilib"
(("#!/bin/sh") (string-append "#!" (which "sh"))))
- #t))))
+ #t))
+ (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)))))
((#:configure-flags flags)
;; The configure flags are largely identical to the flags used by the
;; "GCC ARM embedded" project.