#2469: Linking fails with "multiple definition of `deRefStablePtr'"
----------------------------------+-----------------------------------------
 Reporter:  meteficha             |          Owner:  simonmar
     Type:  bug                   |         Status:  new     
 Priority:  high                  |      Milestone:  6.10.1  
Component:  Compiler (FFI)        |        Version:  6.8.2   
 Severity:  normal                |     Resolution:          
 Keywords:  linker ffi stableptr  |     Difficulty:  Unknown 
 Testcase:                        |   Architecture:  Unknown 
       Os:  Multiple              |  
----------------------------------+-----------------------------------------
Changes (by simonmar):

  * owner:  => simonmar

Comment:

 `deRefStablePtr` is defined like this:

 {{{
 #if defined(__GNUC__)
 # ifndef RTS_STABLE_C
 extern inline
 # endif
 StgPtr deRefStablePtr(StgStablePtr sp)
 {
     ASSERT(stable_ptr_table[(StgWord)sp].ref > 0);
     return stable_ptr_table[(StgWord)sp].addr;
 }
 #else
 /* No support for 'extern inline' */
 extern StgPtr deRefStablePtr(StgStablePtr sp);
 #endif
 }}}

 and `extern inline` is supposed to treat the definition as a macro; that
 is, it never gets emitted into the object file, which is what we want.
 This seems to be working correctly with the various gcc versions I have
 here.

 What gcc versions are installed on the boxes that fail?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2469#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to