Error building ghc on raspberry pi.

roconnor at theorem.ca roconnor at theorem.ca
Sun Jan 20 20:27:18 CET 2013


On Sun, 20 Jan 2013, Karel Gardas wrote:

> 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}"

Okay, I patched the settings filed generted by ./configure in the 
binary-dist and rank make install which completed.  However,

pi at raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...
pi at raspberrypi /tmp/bindist $ ./Main
Segmentation fault
pi at raspberrypi /tmp/bindist $ cat Main.hs
main = putStrLn "Hello World."

Damn it.  So close.  I don't know how make install succeded without 
segfaulting.

-- 
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''



More information about the Glasgow-haskell-users mailing list