From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Karetnikov Subject: Cross-building GHC Date: Sat, 09 Mar 2013 16:23:30 +0400 Message-ID: <87sj443got.fsf@karetnikov.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]:46726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEImR-00029s-Cx for bug-guix@gnu.org; Sat, 09 Mar 2013 07:21:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEImK-0002up-VT for bug-guix@gnu.org; Sat, 09 Mar 2013 07:21:39 -0500 Received: from [2a01:7e00::f03c:91ff:fedf:181] (port=36319 helo=cooksoni.karetnikov.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEImK-0002to-PO for bug-guix@gnu.org; Sat, 09 Mar 2013 07:21:32 -0500 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: bug-guix@gnu.org --=-=-= I'm trying to cross-build the Glasgow Haskell Compiler 7.6.2 [1]. I got stuck when I was trying to build a cross-compiler (Stage 1). For some reason, it uses '/usr/bin/ld' instead of a cross-linker. Could anyone try to reproduce the problem? The process is described here [2]. If I got it right, you have to run # ./configure && make && make install && make clean twice (Stage 0 and libs boot phases). Then you should be able to build the Stage 1 compiler: # ./configure --target=mips64el-linux \ --with-gcc=/nix/store/khdyz3i5aih56lxfk6hjvp3884apm7qb-gcc-cross-mips64el-linux-gnu-4.7.2/bin/mips64el-linux-gnu-gcc \ --with-ld=/nix/store/bqw0chxysv4x73mf6bv7jqmgy7553xqh-binutils-cross-mips64el-linux-gnu-2.22/bin/mips64el-linux-gnu-ld \ --with-nm=/nix/store/khdyz3i5aih56lxfk6hjvp3884apm7qb-gcc-cross-mips64el-linux-gnu-4.7.2/bin/mips64el-linux-gnu-gcc-nm However, the above doesn't work. I'm getting the following error: /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: 8) /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: 8) /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: 8) /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: 8) /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gnu-2.17/include/../lib/crt1.o: could not read symbols: File in wrong format collect2: ld returned 1 exit status configure: error: Building ghc-pwd failed The GCC-related configuration, which works for a "hello world" program, can be found here [3]. The only difference is that I used # export LIBRARY_PATH=/nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gnu-2.17/include instead of C_LIBRARY_PATH. [1] http://www.haskell.org/ghc/dist/7.6.2/ghc-7.6.2-src.tar.bz2 [2] http://hackage.haskell.org/trac/ghc/wiki/CrossCompilation [3] https://lists.gnu.org/archive/html/bug-guix/2013-03/msg00047.html --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJROynGAAoJEM+IQzI9IQ385YIP/289OCCGxleaqajpW+xgO0YP CtLig/kQb4zmbTAfFU3z1wRUIVhnPAbvg2V1ZyLaJit8GFDQxOW2uUYZxY6cCchX IfdKP3cekuEfR7oXew1CPxnudsPStylRGSLLJX8C+ICG3TkISTClhBfDmic3ZGDO rle7u11obpr4mYQVMESQ3W8sfYJDwtytBNpl+DmcACZ9swOGIPojXkGHe0LQcERw uMnynYgoEd7ICjgbNQuDvVTntEaJ0MVsVmBJNsQ8Q5K7srCpRklhAyQJscmpKYzx wKPxGUEhZrwr9aoVhZWYGfDyr0szDUuDzroov6SP5A/J6/57kRnKPwXayVi56fhk vnguNa8ei0Y6wotXtdJwsma7NqsYsfjTQKLVoLULS28/IaLIuHSMTjS7FS7VidIF nqjIJvgFf6I8XzurH3VbRsProVB0D8tXVi4xrc83XY9Nr9eDjBwjc5kaUZUFvCqz PprQgZUXMvs/aG01aUfWBexD6nLcCQ1YChvIob9dtnWlvPNJtsp5pA6mUPa1bxff gyXoYkazyHTV5gw8T6CjkVQ197NBSMV2NE/2L8mx54jCJLmq7OyDS+F2s4a5oBa1 tA6Kb4HC9Hj8jyRx1rmuU2BS3Jpo4hG20JlfLmRX86BIu2ihOA8fcMeS2M4u0v1y 2I4Vm/hG8MbJDi1/TtnI =/q2S -----END PGP SIGNATURE----- --=-=-=--