#3705: -fPIC without -dynamic silently ignored
-------------------------------+--------------------------------------------
    Reporter:  asuffield       |       Owner:              
        Type:  bug             |      Status:  new         
    Priority:  normal          |   Component:  Compiler    
     Version:                  |    Keywords:              
          Os:  Linux           |    Testcase:              
Architecture:  x86_64 (amd64)  |     Failure:  None/Unknown
-------------------------------+--------------------------------------------
 {{{
 $ ghc -fPIC -c -o TestF.o TestF.hs
 $ ghc -shared -dynamic TestF.so TestF.o
 /usr/bin/ld: TestF.o: relocation R_X86_64_PC32 against undefined symbol
 `stg_CAF_BLACKHOLE_info'
 can not be used when making a shared object; recompile with -fPIC
 /usr/bin/ld: final link failed: Bad value
 collect2: ld returned 1 exit status

 $ ghc -fPIC -dynamic -c -o TestF.o TestF.hs
 $ ghc -shared -dynamic TestF.so TestF.o
 $
 }}}

 If you attempt to use -fPIC without -dynamic, then you get non-PIC code in
 the .o file. This behaviour is surprising and quite useless.

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