X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverFlags.hs;h=b3bda23701e98dffa40061fb10db04af7247d7e6;hb=b4d045ae655e5eae25b88917cfe75d7dc7689c21;hp=c09e43ad2dc31529c39564a5614b6eb5b44e6fe9;hpb=a558bffdbf9288a5c6620b9553ec4839c8b904e4;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index c09e43a..b3bda23 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -621,11 +621,20 @@ machdepCCOpts -- for "normal" programs, but it doesn't support register variable -- declarations. -- -mdynamic-no-pic: - -- As we don't support haskell code in shared libraries anyway, - -- we might as well turn of PIC code generation and save space and time. - -- This is completely optional. - = return ( ["-no-cpp-precomp","-mdynamic-no-pic"], [] ) - + -- Turn off PIC code generation to save space and time. + -- -fno-common: + -- Don't generate "common" symbols - these are unwanted + -- in dynamic libraries. + + = if opt_PIC + then return ( ["-no-cpp-precomp", "-fno-common"], + ["-fno-common"] ) + else return ( ["-no-cpp-precomp", "-mdynamic-no-pic"], + ["-mdynamic-no-pic"] ) + + | prefixMatch "powerpc" cTARGETPLATFORM && opt_PIC + = return ( ["-fPIC"], ["-fPIC"] ) + | otherwise = return ( [], [] )