#3705: -fPIC without -dynamic silently ignored
---------------------------+------------------------------------------------
  Reporter:  asuffield     |          Owner:                
      Type:  bug           |         Status:  new           
  Priority:  normal        |      Milestone:                
 Component:  Compiler      |        Version:                
Resolution:                |       Keywords:                
Difficulty:                |             Os:  Linux         
  Testcase:                |   Architecture:  x86_64 (amd64)
   Failure:  None/Unknown  |  
---------------------------+------------------------------------------------
Changes (by duncan):

  * difficulty:  =>

Comment:

 It looks like this is behaving as specified. Yes, the message says to use
 -fPIC, and that'd probably be right if we were talking about C code and
 gcc.

 The symbol type R_X86_64_PC32 looks like a PC-relative reference to a
 symbol it expects to find within the same shared object. That's just what
 you would expect from -fPIC without -dynamic.

 Of course what you're doing here is making PIC code that expects to find
 other symbols within the same shared object, but then linking it in such a
 way that the other symbols are in an external shared object. That indeed
 will not work.

 It should in principle be possible to build the rts and standard libs with
 -fPIC and without -dynamic. These would be made into .a libs. Then it
 should be possible to make one huge .so linking in all the Haskell
 packages and rts. Internally to this big .so, all the symbol references
 would be PC-relative and not go via the GOT.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3705#comment:1>
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