gnu: glibc: Refer to the target kernel headers when cross-compiling.

This fixes a regression introduced in
efc4eb1475 whereby the build process
corresponding to 'guix build glibc --target=mips64el-linux-gnu' would
refer to the native headers instead of the target headers, leading to a
build failure:

  ../sysdeps/unix/sysv/linux/statfs64.c: In function ‘__statfs64’:
  ../sysdeps/unix/sysv/linux/statfs64.c:73:1: error: control reaches end of non-void function [-Werror=return-type]
   }
   ^

When we were using CROSS_CPATH instead of CROSS_C_INCLUDE_PATH, the
problem was hidden by the fact that CPATH corresponds to '-I' whereas
C_INCLUDE_PATH corresponds to '-isystem', and '-isystem' directories are
searched after '-I' directories.

* gnu/packages/base.scm (glibc)[arguments]: Refer to the kernel headers
from '%build-target-inputs' when cross-building.
This commit is contained in:
Ludovic Courtès 2016-05-29 23:15:14 +02:00
parent 89d80159b1
commit 28dc10a455
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 4 additions and 1 deletions

View File

@ -532,7 +532,10 @@ store.")
,version)
(string-append "--with-headers="
(assoc-ref %build-inputs "linux-headers")
(assoc-ref ,(if (%current-target-system)
'%build-target-inputs
'%build-inputs)
"linux-headers")
"/include")
;; This is the default for most architectures as of GNU libc 2.21,