<div dir="ltr">Recently, I had to recompile ghc, in order to get the "-dyn" versions of the standard libraries installed. (The standard Ubuntu 12.10 64-bit Linux distribution doesn't include them in its "haskell-platform" package, and you can't upgrade "base" using the normal "cabal iinstall" approach, from what I understand.)<div>
<br></div><div style>When I did this, the "-dyn" versions of the standard libraries were, in fact, installed. However, they were given names with a "-<a href="http://ghc7.4.2.so">ghc7.4.2.so</a>" 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:'courier new',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:'courier new',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' 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 "*.a" version of the <i>HSrts</i> library, instead of the "*.so" version, which is what it really needs. And the reason it's doing this is the "*.so" version has been given a "-ghc7.4.2" 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 "-ghc7.4.2" file name suffix, or</li><li style>rebuild my "*.so"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>