Make ghc -dynamic imply -fPIC for C code
authorDuncan Coutts <duncan@well-typed.com>
Fri, 1 May 2009 12:14:45 +0000 (12:14 +0000)
committerDuncan Coutts <duncan@well-typed.com>
Fri, 1 May 2009 12:14:45 +0000 (12:14 +0000)
commit431e40e1a2f795d5069d97661b7cd55f3e3b05bf
treedbe549ba738b9e073728d28a544b0381b3653c19
parentffafcfbb7e0ef225561a400ed3104c14f8403891
Make ghc -dynamic imply -fPIC for C code
As is already the case for ghc -fPIC. This is needed because ghc -dynamic
means to generate code that is capable of being linked to Haskell shared
libs and for C code the equivalent is -fPIC. Normally C code does not need
-fPIC merely to link to shared libs however Haskell shared libs do not
follow common conventions. In particular the static data cannot be
referenced statically because it cannot be copied by the static linker.
The linker cannot copy them because we do not specify a .size for the
_closure entries (in the .data section) though in principle we could.
compiler/main/DynFlags.hs