Error building ghc on raspberry pi.

Karel Gardas karel.gardas at centrum.cz
Sun Jan 20 19:29:49 CET 2013


On 01/20/13 07:17 PM, roconnor at theorem.ca wrote:
> On Wed, 16 Jan 2013, Karel Gardas wrote:
>
>> You should not IMHO. My patch should solve all your issues. :-) The
>> only issue you may get is that your distro ghc will compile for
>> soft-float ABI and your compiled GHC will compile to hard-float and
>> object files will get mixed somewhere. But I trust your distro ghc
>> builders that this is not the case so both GHCs should compile using
>> hard-float. So issue solved, at least should be. Now I'm just waiting
>> if you verify this or not so I'm either able to submit the patch for
>> inclusion or hack it more...
>
> I switched to using llvm-3.0 from rasbian, and made a lot of progress.
> (In retrospect I built llvm-3.1 using nix, and it was in a completely
> different toolchain than the rest of the build. I should have known that
> it wouldn't work).

Ehm, building LLVM on your own is always a risky business. See my 
blog[1] for more details especially find the post where I compare 
quality of various LLVM builds using various optimization options...

>
> I was able to complete the build of ghc-7.6.1 using Karel's patch and
>
> ./configure --with-llc=/usr/bin/llc-3.0 --with-opt=/usr/bin/opt-3.0
>
> I was able to make binary-dist after doing
>
> mkdir compiler/stage2/doc
>
> However after unpacking the binary distribution and doing a make install
> I get:
>
> Installing library in /tmp/bindist/lib/ghc-7.6.1/ghc-prim-0.3.0.0
> ghc-cabal: Failed to read "target arch" value "ArchARM {armISA = ARMv6,
> armISAExt = [VFPv2], armABI = }"
> make[1]: *** [install_packages] Error 1
> make: *** [install] Error 2
>
> And in particular the installed ghc gives the error:
>
> $ bin/ghc
> Failed to read "target arch" value "ArchARM {armISA = ARMv6, armISAExt =
> [VFPv2], armABI = }"
>
> Sounds to me like Karel's patch is almost, but not quite there.

Looks like you do have corrupted settings file. Recover it by adding 
"HARD" following "armABI = ", so result should be:

ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = HARD}"

That's all what's needed, honestly speaking I don't know why it's 
screwed on your board.

> Karel, maybe you should try deploying a binary-dist on your panda board?

Sorry? What's "binary-dist"? And why I should do that? And what exactly 
do you mean by "deploying"? And on what OS? Ubuntu or Raspbian run in 
Ubuntu chroot?

Karel
[1]: https://ghcarm.wordpress.com/



More information about the Glasgow-haskell-users mailing list