Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/2dd5bf526f4145e6c1012a3117ad1534f45a53c2 >--------------------------------------------------------------- commit 2dd5bf526f4145e6c1012a3117ad1534f45a53c2 Author: Ian Lynagh <[email protected]> Date: Fri Oct 14 20:25:49 2011 +0100 Remove some CPP >--------------------------------------------------------------- compiler/main/DynFlags.hs | 45 +++++++++++++++++++-------------------------- 1 files changed, 19 insertions(+), 26 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 3385c36..708060a 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2458,37 +2458,30 @@ setOptHpcDir arg = upd $ \ d -> d{hpcDir = arg} -- platform. picCCOpts :: DynFlags -> [String] -picCCOpts _dflags -#if darwin_TARGET_OS - -- Apple prefers to do things the other way round. - -- PIC is on by default. - -- -mdynamic-no-pic: - -- Turn off PIC code generation. - -- -fno-common: - -- Don't generate "common" symbols - these are unwanted - -- in dynamic libraries. - - | opt_PIC - = ["-fno-common", "-U __PIC__","-D__PIC__"] - | otherwise - = ["-mdynamic-no-pic"] -#elif mingw32_TARGET_OS - -- no -fPIC for Windows - | opt_PIC - = ["-U __PIC__","-D__PIC__"] - | otherwise - = [] -#else +picCCOpts dflags + = case platformOS (targetPlatform dflags) of + OSDarwin + -- Apple prefers to do things the other way round. + -- PIC is on by default. + -- -mdynamic-no-pic: + -- Turn off PIC code generation. + -- -fno-common: + -- Don't generate "common" symbols - these are unwanted + -- in dynamic libraries. + + | opt_PIC -> ["-fno-common", "-U __PIC__", "-D__PIC__"] + | otherwise -> ["-mdynamic-no-pic"] + OSMinGW32 -- no -fPIC for Windows + | opt_PIC -> ["-U __PIC__", "-D__PIC__"] + | otherwise -> [] + _ -- we need -fPIC for C files when we are compiling with -dynamic, -- otherwise things like stub.c files don't get compiled -- correctly. They need to reference data in the Haskell -- objects, but can't without -fPIC. See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/PositionIndependentCode - | opt_PIC || not opt_Static - = ["-fPIC", "-U __PIC__", "-D__PIC__"] - | otherwise - = [] -#endif + | opt_PIC || not opt_Static -> ["-fPIC", "-U __PIC__", "-D__PIC__"] + | otherwise -> [] -- ----------------------------------------------------------------------------- -- Splitting _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
