all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikita Karetnikov <nikita@karetnikov.org>
To: bug-guix@gnu.org
Subject: Cross-building GHC
Date: Sat, 09 Mar 2013 16:23:30 +0400	[thread overview]
Message-ID: <87sj443got.fsf@karetnikov.org> (raw)

[-- 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 --]

             reply	other threads:[~2013-03-09 12:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09 12:23 Nikita Karetnikov [this message]
2013-03-14 17:32 ` Cross-building GHC 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sj443got.fsf@karetnikov.org \
    --to=nikita@karetnikov.org \
    --cc=bug-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.