Nikolay Amiantov | 18 Jun 14:01 2014
Picon

Building static libraries with -fPIC

Hello all,

I'm trying to build a shared (.so) library written in Haskell with
"foreign export"s, which is statically linked with all needed
dependencies. To do this, as far as I understood, I need to build all
my dependencies (I use Cabal) with -fPIC flag, and also somehow get
RTS static library built with -fPIC. Two questions regarding to this:

1) How can I add a build flag which will be added while building all
my dependencies in Cabal.
2) How can I get needed RTS library.
3) How can I deal with "base"? Can I just build it with Cabal, so this
question reduces to (1)?

Thanks,
Nikolay.

Gmane