From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Karetnikov Subject: Re: Cross-building GHC Date: Thu, 16 May 2013 12:04:58 +0400 Message-ID: <87sj1nnydx.fsf@karetnikov.org> References: <87sj443got.fsf@karetnikov.org> <87620trip2.fsf@gnu.org> <87obelg5iu.fsf@karetnikov.org> <8738vxh8ld.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uct8V-0000QK-JB for bug-guix@gnu.org; Thu, 16 May 2013 04:02:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uct8R-0006SY-46 for bug-guix@gnu.org; Thu, 16 May 2013 04:02:03 -0400 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: bug-guix@gnu.org --=-=-= Content-Transfer-Encoding: quoted-printable I said that "you have to run './configure && make && make install && make clean' [...] to build the Stage 1 compiler." [1] This is not correct: 1. It seems that mips64el is not supported. So it's necessary to port [2] GHC. 2. './configure && make && make install' build the Stage 2 (final) compiler, not Stage 1. I've tried to port through .hc files (as described here [2]). First I installed the cross-compiler to my profile and ran the following commands: # export CPATH=3D"/root/.guix-profile/include" # export LIBRARY_PATH=3D"/root/.guix-profile/lib" # export C_INCLUDE_PATH=3D/nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc= -cross-mips64el-linux-gnu-2.17/include # ln -s /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-li= nux-gnu-2.17/lib/crt1.o /nix/store/x4j44am492nnajlwja1c7gs2ikqkdff4-gcc-cro= ss-mips64el-linux-gnu-4.7.3/lib/gcc/mips64el-linux-gnu/4.7.3/crt1.o # ln -s /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-li= nux-gnu-2.17/lib/crti.o /nix/store/x4j44am492nnajlwja1c7gs2ikqkdff4-gcc-cro= ss-mips64el-linux-gnu-4.7.3/lib/gcc/mips64el-linux-gnu/4.7.3/crti.o # ln -s /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-li= nux-gnu-2.17/lib/crtn.o /nix/store/x4j44am492nnajlwja1c7gs2ikqkdff4-gcc-cro= ss-mips64el-linux-gnu-4.7.3/lib/gcc/mips64el-linux-gnu/4.7.3/crtn.o These symlinks are needed because CROSS_LIBRARY_PATH doesn't work. I tested the above using a simple C program: #include main() { printf("Hello World"); } 'mips64el-linux-gnu-gcc test.c' didn't return any errors. After that I unpacked 'ghc-7.6.3-src.tar.bz2' to 'T'. And replaced '$GHC_PACKAGE_DB_FLAG' with 'package-db' in 'configure' because it failed otherwise. Then I ran these commands: T# cp /bin/pwd utils/ghc-pwd/ghc-pwd T# perl boot T# ./configure --enable-hc-boot --target=3Dmips64el-linux-gnu 'configure' returned lots of errors: [...] /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-= 2.17/include/bits/types.h:128:3: error: #error=20 In file included from /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cro= ss-mips64el-linux-gnu-2.17/include/bits/byteswap.h:27:0: 0, from /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc= -cross-mips64el-linux-gnu-2.17/include/endian.h:60, from /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc= -cross-mips64el-linux-gnu-2.17/include/bits/waitstatus.h:64, from /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc= -cross-mips64el-linux-gnu-2.17/include/stdlib.h:42, from /usr/local/lib/ghc-7.6.3/include/Rts.h:190, from /tmp/ghc6782_0/ghc6782_0.c:1: [...] /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-= 2.17/include/bits/types.h:133:1: error: unknown type name '__STD_TYPE' /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-= 2.17/include/bits/types.h:133:25: error: expected '=3D', ',', ';', 'asm' or '__attribute__' before '__de= v_t' [...] /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-= 2.17/include/stdio.h:678:1: error: unknown type name '__ssize_t' /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-= 2.17/include/stdio.h:781:12: error: unknown type name '__off64_t' /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-= 2.17/include/stdio.h:784:1: error: unknown type name '__off64_t' configure: error: Building ghc-pwd failed Is anything wrong with environment variables? [1] https://lists.gnu.org/archive/html/bug-guix/2013-03/msg00048.html [2] http://hackage.haskell.org/trac/ghc/wiki/Building/Porting --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJRlJMtAAoJEM+IQzI9IQ38aM8P/3LL1Rq1pMkk/DaPWTwEHbS3 gsa/Yo2M3qdBaNygnklwe0KNTwF+/hg9nd7atItCvyig94v9eGaRzo0h3Ar1RSoo /tABIVuyfQM/XKnS2d+n5jnigkLpbxZLrKtmj8dYnZD+tmJGnV4tX4axsJyGWtBR B1fD3C6w3wSsxWRt/oCb5cDLkXcMWgCf4W003y3ZV0pbgnLt754qklDqPuCqHj57 srSRmAg8D3LXHPnXHoO0SVflD/QTopFurjMi0mFiuKbKiH8cd8/+8XAqS+mr4C0g HwRr8zert8TCFmxdjTftK9NMKWtEkP6jEZUTo2lTp1bnAdzBI2MkHQ825oGS2N/A h3Zf99GcKUH4fx5bYNRJaEfQKBGCBuUpdBT2AxvLK6CN9PIgSWUmS0tID9BOfi3U 4+8RFk1MvRWJN7wu07+/f4ifWy7rAdr65bkEzECOPP62X2ERtn6Hem5HI86u8szl aAt+Ehd7bA5sQFhzCnmRLrjEiWIegfJuKzaLwaN/iaaVLnuQvoVFu/PYzzAR2FMt R6N79lwxA11FRQfk7cgIjpXkgLS+jaWx7+KmbkRecqiOD6A9MTCG0QfhujmXmXIH 9xnyTHBfsxz2zz+HE+MD1aoozyq9DTfG1TaxxBhL+VQmSO0hdFGWtpZKv1ZqgbXp xi3RIF5B3/zFqZMhVzg5 =LDoE -----END PGP SIGNATURE----- --=-=-=--