bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-building GHC


From: Ludovic Courtès
Subject: Re: Cross-building GHC
Date: Thu, 16 May 2013 20:16:13 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.3 (gnu/linux)

Nikita Karetnikov <address@hidden> skribis:

> 1. It seems that mips64el is not supported.  So it's necessary to port
>    [2] GHC.

Ouch.  Quite an endeavor, I suppose.

> First I installed the cross-compiler to my profile and ran the following
> commands:
>
> # export CPATH="/root/.guix-profile/include"
> # export LIBRARY_PATH="/root/.guix-profile/lib"
> # export 
> C_INCLUDE_PATH=/nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include
>
> # ln -s 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/lib/crt1.o
>  
> /nix/store/x4j44am492nnajlwja1c7gs2ikqkdff4-gcc-cross-mips64el-linux-gnu-4.7.3/lib/gcc/mips64el-linux-gnu/4.7.3/crt1.o
> # ln -s 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/lib/crti.o
>  
> /nix/store/x4j44am492nnajlwja1c7gs2ikqkdff4-gcc-cross-mips64el-linux-gnu-4.7.3/lib/gcc/mips64el-linux-gnu/4.7.3/crti.o
> # ln -s 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/lib/crtn.o
>  
> /nix/store/x4j44am492nnajlwja1c7gs2ikqkdff4-gcc-cross-mips64el-linux-gnu-4.7.3/lib/gcc/mips64el-linux-gnu/4.7.3/crtn.o
>
> These symlinks are needed because CROSS_LIBRARY_PATH doesn't work.

Oh.  I dropped the ball on this issue, but I hope to get back to it Real
Soon Now.

[...]

> After that I unpacked 'ghc-7.6.3-src.tar.bz2' to 'T'.  And replaced
> '$GHC_PACKAGE_DB_FLAG' with 'package-db' in 'configure' because it
> failed otherwise.
>
> Then I ran these commands:
>
> T# cp /bin/pwd utils/ghc-pwd/ghc-pwd
> T# perl boot
> T# ./configure --enable-hc-boot --target=mips64el-linux-gnu
>
> 'configure' returned lots of errors:
>
> [...]
>
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/bits/types.h:128:3:
>      error: #error 
>
> In file included from 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/bits/byteswap.h:27:0:
>     0,
>                      from 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/endian.h:60,
>                      from 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/bits/waitstatus.h:64,
>                      from 
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/stdlib.h:42,
>                      from /usr/local/lib/ghc-7.6.3/include/Rts.h:190,
>                      from /tmp/ghc6782_0/ghc6782_0.c:1:
>
> [...]
>
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/bits/types.h:133:1:
>      error: unknown type name '__STD_TYPE'
>
> /nix/store/xisav2mcispg63ns8w9x5blvd14gyrd7-glibc-cross-mips64el-linux-gnu-2.17/include/bits/types.h:133:25:
>      error: expected '=', ',', ';', 'asm' or '__attribute__' before '__dev_t'

You need to have both glibc-mipsel.../include and
linux-libre-headers-mipsel.../include in CROSS_CPATH.  Can you check
whether this is the case.

Another possibility is that it’s picking native headers instead of
cross-headers for some reason.  To check whether this is the case, you
can look at the output of the mipsel-...-gcc --verbose, or just strace
that and look at the .h files it opens.

TIA,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]