在 GHC 7.10 RC1 上使用 LLVM 编译 cabal 项目
Compiling a cabal project with LLVM on GHC 7.10 RC1
我试过:
$ 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
我在 cabal build -v
的输出中没有看到任何引用 "PIC" 的内容。
我想我需要 --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
我试过:
$ 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
我在 cabal build -v
的输出中没有看到任何引用 "PIC" 的内容。
我想我需要 --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