diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 131a928d80..b83b67f4a1 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017, 2020 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Clément Lassieur +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,12 +88,27 @@ (define-public gcc-arm-none-eabi-4.9 (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"