Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.6k
    • Issues 5.6k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 642
    • Merge requests 642
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2469

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

Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (FFI)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Multiple
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking