From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Cross Compilation for armhf - libc (stdio.h) missing Date: Mon, 7 Nov 2016 11:12:33 +0100 Message-ID: <20161107111233.6e2b6503@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3guy-0006Y5-WD for guix-devel@gnu.org; Mon, 07 Nov 2016 05:12:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3guv-0005sk-PC for guix-devel@gnu.org; Mon, 07 Nov 2016 05:12:44 -0500 Received: from dd1012.kasserver.com ([85.13.128.8]:53873) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3guv-0005sQ-FU for guix-devel@gnu.org; Mon, 07 Nov 2016 05:12:41 -0500 Received: from localhost (77.116.253.22.wireless.dyn.drei.com [77.116.253.22]) by dd1012.kasserver.com (Postfix) with ESMTPSA id 7B1BE1CA0BEA for ; Mon, 7 Nov 2016 11:12:38 +0100 (CET) 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@gnu.org Hello, I'm trying to build the part of sunxi-tools that is target-specific for the target (2 tools). However, I cannot get it to pick up armhf glibc. What could be the cause? I get: arm-linux-gnueabihf-gcc -g -O0 -Wall -Wextra -std=c99 -Iinclude/ -static -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -D__ARM_PCS_VFP -o sunxi-meminfo meminfo.c meminfo.c:19:19: fatal error: stdio.h: No such file or directory #include ^ compilation terminated. make: *** [Makefile:176: sunxi-meminfo] Error 1 And the patch in order to reproduce it is: diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 77432c4..9c24360 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -43,6 +43,7 @@ #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages base) + #:use-module (gnu packages cross-base) #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages ncurses) #:use-module (gnu packages readline) @@ -1862,45 +1863,54 @@ Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.") ;;http://archives.eyrie.org/software/kerberos/pam-krb5-4.7.tar.xz +;; FIXME https://github.com/linux-sunxi/sunxi-tools/commit/6cd51fe5474ad4e87ac1fcbadcf17487ef57bbaa (define-public sunxi-tools - (package - (name "sunxi-tools") - (version "1.4.1") - (source - (origin - (method url-fetch) - (uri (string-append "https://github.com/linux-sunxi/" - "sunxi-tools/archive/v" version ".tar.gz")) - (sha256 - (base32 "06qd2b4dlzbmzfy4q9n8v5rkkbmgcfdbv4nkkcp4nysi10k7cpfs")) - (modules '((guix build utils))) - (snippet - ;; Remove binaries contained in the tarball which are only for the - ;; target and can be regenerated anyway. - '(delete-file-recursively "bin")) - (file-name (string-append name "-" version ".tar.gz")))) - (native-inputs - `(("pkg-config" ,pkg-config))) - (inputs - `(("libusb" ,libusb))) - (build-system gnu-build-system) - (arguments - `(#:tests? #f ; no tests exist - #:make-flags (list (string-append "PREFIX=" - (assoc-ref %outputs "out")) - "CROSS_COMPILE=" - "CC=gcc" - "all") - #:phases - (modify-phases %standard-phases - (delete 'configure) - (replace 'install - (lambda* (#:key make-flags #:allow-other-keys) - (zero? (apply system* "make" "install-all" "install-misc" - make-flags))))))) - (home-page "https://github.com/linux-sunxi/sunxi-tools") - (synopsis "Hardware management tools for Allwinner computers") - (description "This package contains tools for Allwinner devices: + (let ((triplet "arm-linux-gnueabihf")) + (package + (name "sunxi-tools") + (version "1.4.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/linux-sunxi/" + "sunxi-tools/archive/v" version ".tar.gz")) + (sha256 + (base32 "06qd2b4dlzbmzfy4q9n8v5rkkbmgcfdbv4nkkcp4nysi10k7cpfs")) + (modules '((guix build utils))) + (snippet + ;; Remove binaries contained in the tarball which are only for the + ;; target and can be regenerated anyway. + '(delete-file-recursively "bin")) + (file-name (string-append name "-" version ".tar.gz")))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("cross-gcc" ,(cross-gcc triplet + (cross-binutils triplet) + (cross-libc triplet))) + ;("cross-libc" ,(cross-libc triplet)) +)) + (inputs + `(("libusb" ,libusb))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no tests exist + #:make-flags (list (string-append "PREFIX=" + (assoc-ref %outputs "out")) + (string-append "CROSS_COMPILE=" + ,triplet "-") + (string-append "TARGET_CFLAGS=-g -O0 -Wall -Wextra -std=c99 -Iinclude/ -static -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE") + "CC=gcc" + "all") + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys) + (zero? (apply system* "make" "install-all" "install-misc" + make-flags))))))) + (home-page "https://github.com/linux-sunxi/sunxi-tools") + (synopsis "Hardware management tools for Allwinner computers") + (description "This package contains tools for Allwinner devices: @enumerate @item @command{sunxi-fexc}, @command{bin2fex}, @command{fex2bin}: Compile a textual description of a board (.fex) to a binary representation (.bin). @@ -1915,4 +1925,4 @@ in order to be able to find it. @item @command{sunxi-meminfo}: Prints memory bus settings. @item @command{sunxi-nand-image-builder}: Prepares raw NAND images. @end enumerate") - (license license:gpl2+))) + (license license:gpl2+)))) Then just do $ guix build sunxi-tools .