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 01e8263feb.

* 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.
master
Marius Bakke 2019-02-27 20:28:57 +01:00
parent b4037d82c0
commit b45a97ea84
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
2 changed files with 14 additions and 11 deletions

View File

@ -169,16 +169,6 @@ a target triplet."
(if (string-contains target "mingw")
set-cross-path/mingw
set-cross-path))
(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)))
(add-after 'install 'make-cross-binutils-visible
(cut make-cross-binutils-visible #:target target <...>))
(replace 'install install-strip)))

View File

@ -4,6 +4,7 @@
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
;;;
;;; 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."