Search code examples
haskellllvmghccabalcabal-install

Compiling a cabal project with LLVM on GHC 7.10 RC1


I've tried:

$ cabal install --only-dependencies -w /usr/local/bin/ghc-7.10.0.20141222  --enable-tests --enable-benchmarks --ghc-option=-fllvm --ghc-option=-static
$ cabal configure -w /usr/local/bin/ghc-7.10.0.20141222  --enable-tests --enable-benchmarks --ghc-option=-fllvm --ghc-option=-static
$ cabal build   
Building unagi-chan-0.3.0.0...
Preprocessing library unagi-chan-0.3.0.0...

when making flags consistent: Warning:
    Using native code generator rather than LLVM, as LLVM is incompatible with -fPIC and -dynamic on this platform

I don't see anything referencing "PIC" in the output of cabal build -v.


Solution

  • I guess I needed --disable-shared:

    cabal configure -w /usr/local/bin/ghc-7.10.0.20141222  --enable-tests --enable-benchmarks --ghc-option=-fllvm --ghc-option=-static --disable-shared