summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmPipeline.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-10-23 13:44:30 +0100
committerIan Lynagh <igloo@earth.li>2012-10-23 13:44:30 +0100
commitbba762137354a2113876a0fba6c705b585e3399a (patch)
tree08b82c22e3b2279562281545b326eafef8455d99 /compiler/cmm/CmmPipeline.hs
parent5f37e0c71ff4af8539c5aebc739b006b4f0c6ebf (diff)
downloadhaskell-bba762137354a2113876a0fba6c705b585e3399a.tar.gz
Fix -fPIC on OS X x86
Diffstat (limited to 'compiler/cmm/CmmPipeline.hs')
-rw-r--r--compiler/cmm/CmmPipeline.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/cmm/CmmPipeline.hs b/compiler/cmm/CmmPipeline.hs
index 0cd956ab44..c523b137e0 100644
--- a/compiler/cmm/CmmPipeline.hs
+++ b/compiler/cmm/CmmPipeline.hs
@@ -25,6 +25,7 @@ import ErrUtils
import HscTypes
import Control.Monad
import Outputable
+import Platform
-----------------------------------------------------------------------------
-- | Top level driver for C-- pipeline
@@ -156,6 +157,7 @@ cpsTop hsc_env proc =
return (cafEnv, [g])
where dflags = hsc_dflags hsc_env
+ platform = targetPlatform dflags
dump = dumpGraph dflags
dump' = dumpWith dflags
@@ -177,6 +179,10 @@ cpsTop hsc_env proc =
-- the entry point.
splitting_proc_points = hscTarget dflags /= HscAsm
|| not (tablesNextToCode dflags)
+ || usingDarwinX86Pic
+ usingDarwinX86Pic = platformArch platform == ArchX86
+ && platformOS platform == OSDarwin
+ && gopt Opt_PIC dflags
runUniqSM :: UniqSM a -> IO a
runUniqSM m = do