all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Cross-building GHC
@ 2013-03-09 12:23 Nikita Karetnikov
  2013-03-14 17:32 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Nikita Karetnikov @ 2013-03-09 12:23 UTC (permalink / raw)
  To: bug-guix

[-- Attachment #1: Type: text/plain, Size: 2273 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-05-17 13:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-09 12:23 Cross-building GHC Nikita Karetnikov
2013-03-14 17:32 ` Ludovic Courtès
2013-03-14 19:12   ` Nikita Karetnikov
2013-03-14 23:20     ` Ludovic Courtès
2013-05-16  8:04       ` Nikita Karetnikov
2013-05-16 18:16         ` Ludovic Courtès
2013-05-17  4:03           ` Nikita Karetnikov
2013-05-17 13:31             ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.