I am trying to create a package double-conversionfrom Hackage. It builds OK, but ghci cannot load it. A complaint:
Loading package double-conversion-0.2.0.0 ... linking ... <interactive>:
/home/me/.cabal/lib/double-conversion-0.2.0.0/ghc-7.0.4/HSdouble-conversion-0.2.0.0.o:
unknown symbol `_ZNK17double_conversion6Double5valueEv'
The output nmshows that the character is weak :
nm /home/me/.cabal/lib/double-conversion-0.2.0.0/ghc-7.0.4/HSdouble-conversion-0.2.0.0.o \
| grep _ZNK17double_conversion6Double5valueEv
00000000 W _ZNK17double_conversion6Double5valueEv
This is the only weak character in the file, and indeed, as far as I can tell, there are packages compiled by GHC around the world.
The problematic function seems to be FFI, written in C ++ and defined inline double-conversion/src/double.h. This is not the only built-in function, but only this one is marked as weak.
As a stop measure, I have moved the out-of-line function and the package is now loading. But there obviously is some kind of problem. Why is this feature weak? Why are other functions not? Should ghc complain about weak characters? Should I write down the error, and if so, who needs it (double conversion, gcc, ghc, someone else?)
System data: Gentoo Linux, gcc-4.4.5, ghc-7.0.4, cabal-1.10.2.0.
source
share