
Pedro Baltazar Vasconcelos wrote:
Hello,
Hello Pedro! (Long time, no see :-)
I have experienced the same issue a couple of years ago with Andy King's experimental PPL bindings for the Glasgow Haskell compiler (GHC). The problem was (and still is, I think) the reason why there is no "official" Haskell/GHC binding in the PPL distribution. I also contacted Simon Marlow on the GHC development side and he acknowledged the problem but didnt't have a solution for it in the near horizon (in the longer run, they might stop using GMP inside the Haskell runtime system).
Yes, I have read http://hackage.haskell.org/trac/ghc/ticket/311 and http://www.nabble.com/FFI-Bindings-to-Libraries-using-GMP-t4420123.html
Since I desperately needed to use the PPL with my Haskell programs I did a quick and dirty hack that worked (under Linux at least):
- create a duplicate libmygmp with renamed symbols (with a prefix);
- create a special libmyppl that uses libmygmp instead of libgmp;
- link my Haskell code with libmyppl.
I used objcopy on the library binaries rather than modify the sources. But for some reason I could only get this to work with the static libraries. Anyway, I can pass you a short script that does the library renaming if you are interested.
Yes, please! Why not posting it here? Ciao,
Roberto