Linking fails with "multiple definition of `deRefStablePtr'"
Package Hipmunk-0.1 in Hackage compiles fine, but when compiling !HipmunkPlayground-0.1 it fails with something like (this message from Hackage build log)
Building executable: HipmunkPlayground... Creating dist/build/HipmunkPlayground (and its parents) Creating dist/build/HipmunkPlayground/HipmunkPlayground-tmp (and its parents) /usr/local/bin/ghc -o dist/build/HipmunkPlayground/HipmunkPlayground --make -hide-all-packages -i -idist/build/autogen -idist/build/HipmunkPlayground/HipmunkPlayground-tmp -i. -Idist/build/HipmunkPlayground/HipmunkPlayground-tmp -odir dist/build/HipmunkPlayground/HipmunkPlayground-tmp -hidir dist/build/HipmunkPlayground/HipmunkPlayground-tmp -stubdir dist/build/HipmunkPlayground/HipmunkPlayground-tmp -package containers-0.1.0.1 -package base-18.104.22.168 -package Hipmunk-0.1 -package OpenGL-22.214.171.124 -package GLFW-0.3 -O -Wall ./Playground.hs [1 of 1] Compiling Main ( ./Playground.hs, dist/build/HipmunkPlayground/HipmunkPlayground-tmp/Main.o ) Linking dist/build/HipmunkPlayground/HipmunkPlayground ... /usr/local/lib/ghc-6.8.2/libHSrts.a(Stable.o): In function `deRefStablePtr': Stable.c:(.text+0x0): multiple definition of `deRefStablePtr' /usr/local/tmp/archive/install/lib/Hipmunk-0.1/ghc-6.8.2/libHSHipmunk-0.1.a(Space_stub.o):Space_stub.c:(.text+0x0): first defined here collect2: ld returned 1 exit status
This bug has been observed on some configurations, but not on some others:
|*Failed*||My 2nd box||x86_32||Debian Linux||GHC 6.8.2|
|*Failed*||dons' box||???||??? Linux||GHC 6.8.2|
|*Failed*||Antoines's box||x86_??||Mac OS 10.5||GHC 6.8.2|
|Ok||My 1st box||x86_64||Gentoo Linux||GHC 6.8.3|
|Ok||My 3rd box||x86_32||Windows XP||GHC 6.8.1|
On all cases that failed above, the message was about multiple definition of defRefStablePtr (which Hipmunk doesn't use directly). On my 2nd box and on dons' one, it was confirmed that configuring the Hipmunk package (not HipmunkPlayground where the problem appears) with "--enable-split-objs" makes everything work. I think this is a GHC bug because it works on some boxes and because there's nothing fancy on Hipmunk (specially about StablePtr's).
Some possibly useful links:
I don't have a clue on what is needed to reproduce this bug, but I'll try to give any info as requested. At first I thought about bug 2100 that got fixed in 6.8.3, but my 3rd box with 6.8.1 doesn't complain.