From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: riscv cross toolchain - C_INCLUDE_PATH Date: Fri, 30 Dec 2016 19:52:52 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN2IU-0002Pq-Nt for guix-devel@gnu.org; Fri, 30 Dec 2016 13:52:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cN2IQ-0002ed-3k for guix-devel@gnu.org; Fri, 30 Dec 2016 13:52:58 -0500 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:34572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cN2IP-0002e9-Vk for guix-devel@gnu.org; Fri, 30 Dec 2016 13:52:54 -0500 Received: by mail-qt0-x22d.google.com with SMTP id d45so178541870qta.1 for ; Fri, 30 Dec 2016 10:52:53 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel Hi guix, I'm trying to build a riscv cross toolchain. Why do I have to reset C_INCLUDE_PATH to get glibc to build? It seems to me that all the cross packages shouldn't be in the C_INCLUDE_PATH. Some insight would be greatly appreciated. export C_INCLUDE_PATH=3D"/gnu/store/sjg2km4jy29wbwpisaab8z0jl5h9v9mn-riscv-= glibc-2.24.90-1.e84d3a5-checkout/include:/gnu/store/7nqgj7nz2ypl7dwmjkx0hsw= bjf0w1a63-gcc-cross-sans-libc-riscv64-unknown-linux-gnu-6.1.0-1.287c5cb/inc= lude:/gnu/store/pd7w87bjcq2n4dr481gk14d4y1p2iiaz-binutils-cross-riscv64-unk= nown-linux-gnu-2.27-1.8c5f683/include:/gnu/store/zpkwh5b3b3hrlpckdpb0givgqg= 5rf8gn-gettext-minimal-0.19.8.1/include:/gnu/store/d5nscny560slzpljixqzim6b= 8ms7hhv2-bzip2-1.0.6/include:/gnu/store/4yg6q1kp856m68arkpqc85hqgbffhpxf-xz= -5.2.2/include:/gnu/store/06icf5h4z83mw5g17a58fy26z14dsj9z-file-5.28/includ= e:/gnu/store/k03y1lfaj1xw0d7j2lxdil8ii5c67fdy-gawk-4.1.4/include:/gnu/store= /c5ihjcdxsm9086323bn2j67v7z34lc1a-make-4.2.1/include:/gnu/store/4xxd00drj8g= jcr84xdfna44qak2vhwmf-binutils-2.27/include:/gnu/store/y1g6991kxvdk4vxhsq07= r5saww30v8dq-gcc-4.9.4/include:/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-= glibc-2.24/include:/gnu/store/p1qnhavlg6d9mgv6569c8pici37v2dak-linux-libre-= headers-cross-riscv64-unknown-linux-gnu-4.4.18/include:/gnu/store/jc898psn5= yc9s328nn8fya3sc2daf037-linux-libre-headers-4.4.18/include" (define-public (riscv-cross-glibc target) (let ((glibc (cross-libc target (riscv-cross-gcc target) (riscv-cross-binutils target) (riscv-cross-kernel-headers target))) (commit "e84d3a58c42e29cc162efa0446bb0a1e3554dde4") (revision "1")) (package (inherit glibc) (version (string-append "2.24.90-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/riscv/riscv-glibc") (commit commit))) (file-name (string-append "riscv-glibc-" version "-checkout= ")) (sha256 (base32 "0pbg4f7y7l5kwvb6z8c7s6cp8nrypkvz6cgcc2m03k671p1zwgpi")))= ) (arguments (substitute-keyword-arguments (package-arguments glibc) ((#:configure-flags configure-flags) `(cons "--disable-werror" ,configure-flags)) ((#:phases phases) `(modify-phases ,phases (add-before 'build 'reset-c-include-path (lambda* (#:key inputs #:allow-other-keys) (setenv "C_INCLUDE_PATH" (string-append (assoc-ref inputs "kernel-headers") "/include")))))))))))