[Haskell-cafe] Make shared library - questions

Max Bolingbroke batterseapower at hotmail.com
Fri Aug 26 16:41:18 CEST 2011


On 26 August 2011 13:52, Sergiy Nazarenko <nazarenko.sergiy at gmail.com> wrote:
> /usr/local/lib/ghc-6.12.3/base-4.2.0.2/libHSbase-4.2.0.2.a(Conc__270.o):
> relocation R_X86_64_32 against
> `base_GHCziConc_ensureIOManagerIsRunning1_closure' can not be used when
> making a shared object; recompile with -fPIC

So it looks like you will have to recompile the base libraries with
-fPIC (or try this on Windows, where PIC is unnecessary).

The way I would do this personally is to recompile all of GHC, and in
mk/build.mk set the GhcLibHcOpts to -fPIC. There may be a way to just
recompile the base library (and dependents) using Cabal, but I'm less
sure about that path.

Note that using -fPIC will probably impose a performance penalty on
the library code.

Max



More information about the Haskell-Cafe mailing list