Commit 28a5c73a authored by Ian Lynagh's avatar Ian Lynagh

Move -fno-cse flags from Makefile into pragmas

These are needed for GLOBAL_VAR's to work properly
parent 9fd41268
...@@ -576,18 +576,6 @@ endif ...@@ -576,18 +576,6 @@ endif
#simplCore/SimplEnv_HC_OPTS = -auto-all #simplCore/SimplEnv_HC_OPTS = -auto-all
#simplCore/SimplUtils_HC_OPTS = -auto-all #simplCore/SimplUtils_HC_OPTS = -auto-all
# CSE interacts badly with top-level IORefs (reportedly in DriverState and
# DriverMkDepend), causing some of them to be commoned up. We have a fix for
# this in 5.00+, but earlier versions of the compiler will need CSE turned off.
# To be on the safe side, we disable CSE in *all* modules with top-level IORefs.
ghci/InteractiveUI_HC_OPTS = -fno-cse
main/CmdLineOpts_HC_OPTS = -fno-cse
main/DriverMkDepend_HC_OPTS = -fno-cse
main/DriverPipeline_HC_OPTS = -fno-cse
main/Finder_HC_OPTS = -fno-cse
main/SysTools_HC_OPTS = -fno-cse
main/StaticFlags_HC_OPTS = -fno-cse
# The #include is vital for the via-C route, else the C # The #include is vital for the via-C route, else the C
# compiler doesn't realise that the stcall foreign imports are indeed # compiler doesn't realise that the stcall foreign imports are indeed
# stdcall, and doesn't generate the Foo@8 name for them # stdcall, and doesn't generate the Foo@8 name for them
......
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
-- Monadery code used in InteractiveUI -- Monadery code used in InteractiveUI
......
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
{-# OPTIONS -#include "Linker.h" #-} {-# OPTIONS -#include "Linker.h" #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
......
...@@ -14,6 +14,9 @@ necessary. ...@@ -14,6 +14,9 @@ necessary.
\begin{code} \begin{code}
{-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-} {-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-}
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
module Linker ( HValue, getHValue, showLinkerState, module Linker ( HValue, getHValue, showLinkerState,
linkExpr, unload, withExtendedLinkEnv, linkExpr, unload, withExtendedLinkEnv,
extendLinkEnv, deleteFromLinkEnv, extendLinkEnv, deleteFromLinkEnv,
......
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
......
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
-- GHC Driver -- GHC Driver
......
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- --
-- Static flags -- Static flags
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
\begin{code} \begin{code}
{-# OPTIONS -fno-cse #-}
-- -fno-cse is needed for GLOBAL_VAR's to behave properly
module SysTools ( module SysTools (
-- Initialisation -- Initialisation
initSysTools, initSysTools,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment