@@ -22,10 +22,13 @@ import Fingerprint
23import GhcMonad
23import GhcMonad
24import GhcPlugins
24import GhcPlugins
26import Data.IORef
25import Data.IORef
27import Control.Exception
26import Control.Exception
28import FileCleanup
27import FileCleanup
30----------------------------------------------------------------------
33----------------------------------------------------------------------
31-- GHC setup
34-- GHC setup
@@ -62,25 +65,40 @@ runGhcEnv env act = do
62 cleanTempFiles dflags
65 cleanTempFiles dflags
63 cleanTempDirs dflags
66 cleanTempDirs dflags
66−-- Fake DynFlags which are mostly undefined, but define enough to do a little bit
68+-- Fake DynFlags which are mostly undefined, but define enough to do a
67fakeDynFlags :: DynFlags
70fakeDynFlags :: DynFlags
68fakeDynFlags = defaultDynFlags settings ([], [])
71fakeDynFlags = defaultDynFlags settings ([], [])
70 settings = Settings
73 settings = Settings
71− {sTargetPlatform = Platform
74+ { sTargetPlatform = platform
72− {platformWordSize = 8
73− ,platformOS = OSUnknown
74− ,platformUnregisterised = True
76− ,sPlatformConstants = PlatformConstants
75+ , sPlatformConstants = platformConstants
77− {pc_DYNAMIC_BY_DEFAULT = False
80−#ifndef GHC_STABLE
76+#ifdef GHC_STABLE
81− ,sIntegerLibraryType = IntegerSimple
77+ , sProgramName = "ghc"
78+ , sProjectVersion = cProjectVersion
79+ , sOpt_P_fingerprint = fingerprint0
81+ , sGhcNameVersion = GhcNameVersion
82+ { ghcNameVersion_programName = "ghc"
83+ , ghcNameVersion_projectVersion = cProjectVersion
85+ , sFileSettings = FileSettings
86+ { -- fileSettings_tmpDir = "."
88+ , sPlatformMisc = PlatformMisc
89+ { platformMisc_integerLibraryType = IntegerSimple
91+ , sToolSettings = ToolSettings
92+ { toolSettings_opt_P_fingerprint = fingerprint0
83− ,sProjectVersion = cProjectVersion
95+ }
84− ,sProgramName = "ghc"
96+ platform = Platform
85− ,sOpt_P_fingerprint = fingerprint0
97+ { platformWordSize=8
98+ , platformOS=OSUnknown
99+ , platformUnregisterised=True
101+ platformConstants = PlatformConstants
102+ { pc_DYNAMIC_BY_DEFAULT=False