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