From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Cross-building GHC Date: Thu, 14 Mar 2013 18:32:09 +0100 Message-ID: <87620trip2.fsf@gnu.org> References: <87sj443got.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGC10-0007v1-JI for bug-guix@gnu.org; Thu, 14 Mar 2013 13:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGC0p-00040H-SL for bug-guix@gnu.org; Thu, 14 Mar 2013 13:32:30 -0400 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=34730 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGC0p-0003xR-L6 for bug-guix@gnu.org; Thu, 14 Mar 2013 13:32:19 -0400 In-Reply-To: <87sj443got.fsf@karetnikov.org> (Nikita Karetnikov's message of "Sat, 09 Mar 2013 16:23:30 +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: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: > 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. You mean it _tries_ to use it, because it=E2=80=99s not available in chroot builds, right? > # ./configure --target=3Dmips64el-linux \ > --with-gcc=3D/nix/store/khdyz3i5aih56lxfk6hjvp3884apm7qb-gc= c-cross-mips64el-linux-gnu-4.7.2/bin/mips64el-linux-gnu-gcc \ > --with-ld=3D/nix/store/bqw0chxysv4x73mf6bv7jqmgy7553xqh-bin= utils-cross-mips64el-linux-gnu-2.22/bin/mips64el-linux-gnu-ld \ > --with-nm=3D/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-mips= 64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: = 8) > /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips= 64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: = 8) > /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips= 64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: = 8) > /usr/bin/ld: /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips= 64el-linux-gnu-2.17/include/../lib/crt1.o: Relocations in generic ELF (EM: = 8) > /nix/store/mifp2p1zjlvb4ndslw1r8grkpglybqjf-glibc-cross-mips64el-linux-gn= u-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 Perhaps it needs both a native GCC and a cross-GCC (ditto for =E2=80=98ld= =E2=80=99), no? (For instance because ghc-pwd is a program to run during the build, so it needs to be a native program.) Does it have --with-target-gcc or similar in addition to --with-gcc? If not, you should find the Makefile that triggers the faulty /usr/bin/ld invocation above, and see if you could patch it somehow. Wild guesses & free advice. ;-) Ludo=E2=80=99.