Mac, XCode 4, homebrew Haskell: Can't install utf8-light?
I don't understand the following error message but I do know that I've installed utf8-light on Linux before without problems. Can someone shed light on what's wrong? Is this an LLVM problem, GHC 7 problem or utf8-light problem?
$ cabal install utf8-light
Resolving dependencies...
Configuring utf8-light-0.4...
Preprocessing library utf8-light-0.4...
Building utf8-light-0.4...
[1 of 1] Compiling Codec.Binary.UTF8.Light ( src/Codec/Binary/UTF8/Light.hs, dist/build/Codec/Binary/UTF8/Light.o )
SpecConstr
Function `$j_s2oG{v} [lid]'
has five call patterns, but the limit is 3
Use -fspec-constr-count=n to set the bound
Use -dppr-debug to see specialisations
In file included from /usr/local/Cellar/ghc/7.0.3/lib/ghc-7.0.3/include/Stg.h:230,
from /var/folders/1+/1+3Ih2g9EriMfl8UHRtdQU+++TM/-Tmp-/ghc39083_0/ghc39083_0.hc:3:0:
/usr/local/Cellar/ghc/7.0.3/lib/ghc-7.0.3/include/st开发者_高级运维g/Regs.h:177:0:
sorry, unimplemented: LLVM cannot handle register variable ‘R1’, report a bug
cabal: Error: some packages failed to install:
utf8-light-0.4 failed during the building phase. The exception was:
ExitFailure 1
Since this is a problem with LLVM on the Mac, you have a couple of options:
- install GHC 7.0.3 (which fixes this issue, IIRC),
- wait until next week when the new version of the Haskell Platform comes out
- compile via one of GHC's other backends, such as -fasm or -fvia-C
E.g.
$ cabal install utf8-string --ghc-options=-fasm
should force the use of the native codegen.
This isn't all that helpful, but googling the issue brought me to this bug report. It seems like it's an LLVM problem and has nothing to do with Haskell. That said, I don't really know what I'm talking about and I have no idea how to fix it. Sorry I couldn't be more helpful.
llvm-gcc and llvm do not support global register-pinned variables. So, the only solution will be to rewrite the code not to use them. Local variables are fine, since it's possible to rewrite the access to them into inline asm automagically.
精彩评论