Error building ghc on raspberry pi.

Thijs Alkemade me at thijsalkema.de
Mon Jan 14 17:50:38 CET 2013


Op 14 jan. 2013, om 17:30 heeft roconnor at theorem.ca het volgende geschreven:

> On Thu, 10 Jan 2013, Karel Gardas wrote:
> 
>> 
>> Hmm, are you using Raspbian? I.e. hard-float abi caught my eye in case of ARMv6/ARM11 chip here...
>> 
>> I'm afraid LLVM is not well guided in your case so could you be so kind and test if adding -optlc=-mattr=+vfp2 helps? You need to add it to your build.mk probably and you will need to rebuild everything again...
> 
> No change with
> 
> SRC_HC_OPTS        = -H64m -Rghc-timing -optc-mfloat-abi=hard -optc-march=armv6 -optc-mfpu=vfp -optlc=-mattr=+vfp2
> GhcStage1HcOpts    = -O -fllvm
> GhcStage2HcOpts    = -O0 -fllvm
> GhcLibHcOpts       = -O -fllvm
> 
> I still get the error:
> 
> ===--- building final phase
> make -r --no-print-directory -f ghc.mk phase=final all
>  LD libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o
> /usr/bin/ld: error: libraries/ghc-prim/dist-install/build/cbits/debug.o uses VFP register arguments, libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o does not
> /usr/bin/ld: failed to merge target specific data of file libraries/ghc-prim/dist-install/build/cbits/debug.o
> 
> I don't really understand what is going on here.  The file libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o doesn't even exist, so when I manually run /usr/bin/ld I get:
> 
> $ /usr/bin/ld libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o
> /usr/bin/ld: cannot find libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o: No such file or directory
> 
> What is make really doing here?
> 
> My research suggests that this error is a symptom of trying to link something without the hard-float ABI together with something with a soft-float ABI.  But I don't know where libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o is coming from.

libraries/ghc-prim/dist-install/build/HSghc-prim-0.3.0.0.o is the output ld was asked to generate. Apparently, some of the input .o files didn't use VFP register arguments, so ld concluded that the output should also not use VFP register arguments. But then ld encountered a .o file that did use VFP register arguments, and threw an error (something in cbits, so probably built with different CFLAGS).

From your flags I'd say you miss -optlc-float-abi=hard. I had it in GhcLibHcOpts, but I'm not sure that is the correct way to ensure it is passed to everything exactly once.

Thijs


More information about the Glasgow-haskell-users mailing list