#2469: Linking fails with "multiple definition of `deRefStablePtr'"
-------------------------------------+--------------------------------------
    Reporter:  meteficha             |       Owner:                
        Type:  bug                   |      Status:  new           
    Priority:  normal                |   Component:  Compiler (FFI)
     Version:  6.8.2                 |    Severity:  normal        
    Keywords:  linker ffi stableptr  |    Testcase:                
Architecture:  Unknown               |          Os:  Multiple      
-------------------------------------+--------------------------------------
 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-3.0.1.0 -package Hipmunk-0.1 -package
 OpenGL-2.2.1.1 -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:

 || '''Worked''' || '''Box tried''' || '''Arch''' || '''OS'''     ||
 '''Version''' ||
 || ''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     ||
 || ''Failed''   || Hackage         || ???        || ???          || 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:
  *
 
http://hackage.haskell.org/packages/archive/HipmunkPlayground/0.1/logs/failure/ghc-6.8
  * http://www.haskell.org/pipermail/haskell-cafe/2008-July/045543.html

 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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2469>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to