From b45a97ea84befd28b6191aa9ca320b8758ee8090 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 27 Feb 2019 20:28:57 +0100 Subject: gnu: GCC: Move cross-toolchain build fix to (gnu packages cross-base). This makes sure it is inherited by packages using (cross-gcc ...). This commit is a followup to 01e8263febb9634564b4b73af49b81a36567a11b. * gnu/build/cross-toolchain.scm (cross-gcc-build-phases): Move 'treat-glibc-as-system-header' phase ... * gnu/packages/cross-base.scm (cross-gcc-arguments): ... here. --- gnu/packages/cross-base.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'gnu/packages/cross-base.scm') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 8fe9d5b6d6..6a092727c1 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis ;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2019 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -165,7 +166,19 @@ base compiler and using LIBC (which may be either a libc package or #f.)" ,flags)) flags)) ((#:phases phases) - `(cross-gcc-build-phases ,target ,phases)))))) + `(cross-gcc-build-phases + ,target + (modify-phases ,phases + (add-before 'configure 'treat-glibc-as-system-header + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "libc"))) + (when libc + ;; For GCC6 and later, make sure Glibc is treated as a "system + ;; header" such that #include_next does the right thing. + (for-each (lambda (var) + (setenv var (string-append libc "/include"))) + '("CROSS_C_INCLUDE_PATH" "CROSS_CPLUS_INCLUDE_PATH"))) + #t)))))))))) (define (cross-gcc-patches target) "Return GCC patches needed for TARGET." -- cgit 1.4.1