[Haskell-cafe] Request for help: Recompile of ghc producing "...-ghc7.4.2.so"s, which break project builds.

Captain Freako capn.freako at gmail.com
Sat Apr 27 15:37:43 CEST 2013

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.)

When I did this, the "-dyn" versions of the standard libraries were, in
fact, installed. However, they were given names with a "-ghc7.4.2.so"
suffix. And this is causing the build of a previously working project to
break, thusly:

ghc -o libami.so -shared -dynamic -package parsec *-lHSrts* -lm -lffi -lrt
AMIParse.o AMIModel.o ami_model.o ExmplUsrModel.o Filter.o

/usr/bin/ld: /usr/lib/ghc-7.4.2/*libHSrts.a*(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

The problem is this: the linker is picking up the "*.a" version of the *
HSrts* 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:

dbanas at dbanas-lap:~/prj/AMI-Tool$ l /usr/lib/ghc-7.4.2/libHSrts*




So, it seems to me that I need to either:

   1. Tell the linker about the possibility of a "-ghc7.4.2" file name
   suffix, or
   2. rebuild my "*.so"s without that suffix.

*Can anyone tell me:*

   - *How to accomplish either #1 or #2, above?*
   - *Which one is the preferred solution to the problem?*
   - *Am I completely off in the weeds?*
   - *If so, what should I really be doing, in order to fix this issue?*

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130427/fab78563/attachment.htm>

More information about the Haskell-Cafe mailing list