Hi !<div><br></div><div>I&#39;m trying to compile shared library. This library will use as part of plugin for some program.</div><div>If I compile library with option -dynamic my library has links for HS libraries like <a href="http://libHSbase-4.2.0.2-ghc6.12.3.so">libHSbase-4.2.0.2-ghc6.12.3.so</a> and so on. </div>
<div>But program has crashed constantly.</div><div><br></div><div>Is it possible to make shared library without -dynamic flag? I want to try to make library without dependencies.</div><div><br></div><div>According to <a href="http://www.well-typed.com/blog/30">http://www.well-typed.com/blog/30</a> theoretically I can do this but I found this impossible -  <a href="http://hackage.haskell.org/trac/ghc/ticket/3704">http://hackage.haskell.org/trac/ghc/ticket/3704</a></div>
<div>My options to compile:</div><div>ghc -O2 --make -no-hs-main -dynamic -shared -fPIC -optl &#39;-shared&#39; -optc &#39;-DMODULE=MyLib&#39; -o MyLib.so MyLib.hs module_init.c  -optl-Wl -lHSrts-ghc6.12.3</div><div><br></div>
<div>If I try compile without -dynamic I get error:</div><div><div>/usr/bin/ld: /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&#39; can not be used when making a shared object; recompile with -fPIC</div>
<div>/usr/local/lib/ghc-6.12.3/base-4.2.0.2/libHSbase-4.2.0.2.a: could not read symbols: Bad value</div><div>collect2: ld returned 1 exit status</div></div><div><br></div><div><br></div><div><br></div><div>My system is:</div>
<div>Cenos 5.6</div><div>ghc6.12.3</div><div>gcc-4.2.1</div><div><br></div><div>Cheers,</div><div>Sergiy</div>