<div dir="ltr">Recently, I had to recompile ghc, in order to get the &quot;-dyn&quot; versions of the standard libraries installed. (The standard Ubuntu 12.10 64-bit Linux distribution doesn&#39;t include them in its &quot;haskell-platform&quot; package, and you can&#39;t upgrade &quot;base&quot; using the normal &quot;cabal iinstall&quot; approach, from what I understand.)<div>
<br></div><div style>When I did this, the &quot;-dyn&quot; versions of the standard libraries were, in fact, installed. However, they were given names with a &quot;-<a href="http://ghc7.4.2.so">ghc7.4.2.so</a>&quot; suffix. And this is causing the build of a previously working project to break, thusly:</div>
<div style><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div><span style="color:rgb(0,0,255);font-family:&#39;courier new&#39;,monospace;font-size:x-small">ghc -o libami.so -shared -dynamic -package parsec <b>-lHSrts</b> -lm -lffi -lrt AMIParse.o AMIModel.o ami_model.o ExmplUsrModel.o Filter.o</span><br>
</div><div><span style="color:rgb(0,0,255);font-family:&#39;courier new&#39;,monospace;font-size:x-small"><br></span></div><div><font color="#0000ff" face="courier new, monospace" size="1">/usr/bin/ld: /usr/lib/ghc-7.4.2/<b>libHSrts.a</b>(RtsAPI.o): relocation R_X86_64_32S against `ghczmprim_GHCziTypes_Czh_con_info&#39; can not be used when making a shared object; recompile with -fPIC</font></div>
<div><br></div></div></div></blockquote><div style><div style>The problem is this: the linker is picking up the &quot;*.a&quot; version of the <i>HSrts</i> library, instead of the &quot;*.so&quot; version, which is what it really needs. And the reason it&#39;s doing this is the &quot;*.so&quot; version has been given a &quot;-ghc7.4.2&quot; suffix:</div>
<div style><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style><div style><font face="courier new, monospace" size="1" color="#0000ff">dbanas@dbanas-lap:~/prj/AMI-Tool$ l /usr/lib/ghc-7.4.2/libHSrts*</font></div>
</div></div><div style><div style><div style><font face="courier new, monospace" size="1" color="#0000ff">/usr/lib/ghc-7.4.2/libHSrts.a</font></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style><font color="#0000ff" face="courier new, monospace" size="1">{snip}</font></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>
<div style><font face="courier new, monospace" size="1" color="#0000ff">/usr/lib/ghc-7.4.2/libHSrts<b>-ghc7.4.2</b>.so*</font></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div style><div style><div style><font color="#0000ff" face="courier new, monospace" size="1">{snip}</font></div></div></div></blockquote><div style><div style><div><br></div><div style>So, it seems to me that I need to either:</div>
<div style><ol style><li style>Tell the linker about the possibility of a &quot;-ghc7.4.2&quot; file name suffix, or</li><li style>rebuild my &quot;*.so&quot;s without that suffix.</li></ol><b>Can anyone tell me:</b></div>
<div style><ul style><li style><b>How to accomplish either #1 or #2, above?</b></li><li style><b>Which one is the preferred solution to the problem?</b></li><li style><b>Am I completely off in the weeds?</b></li><li style>
<b>If so, what should I really be doing, in order to fix this issue?</b></li></ul><div style>Thanks!</div><div style>-db</div><div style><br></div></div></div></div></div>