Make initSysTools use the dflags it is passed, rather than defaultDynFlags
authorIan Lynagh <igloo@earth.li>
Sat, 14 Jun 2008 12:28:34 +0000 (12:28 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 14 Jun 2008 12:28:34 +0000 (12:28 +0000)
compiler/main/GHC.hs
compiler/main/SysTools.lhs

index 7d3ef50..bf3bfd1 100644 (file)
@@ -351,8 +351,8 @@ newSession mb_top_dir = do
   installSignalHandlers
 
   initStaticOpts
-  dflags0 <- initSysTools mb_top_dir defaultDynFlags
-  dflags  <- initDynFlags dflags0
+  dflags0 <- initDynFlags defaultDynFlags
+  dflags <- initSysTools mb_top_dir dflags0
   env <- newHscEnv dflags
   ref <- newIORef env
   return (Session ref)
index 96833c8..12fc36e 100644 (file)
@@ -149,7 +149,7 @@ initSysTools :: Maybe String    -- Maybe TopDir path (without the '-B' prefix)
                                 --      (c) the GHC usage message
 
 
-initSysTools mbMinusB _
+initSysTools mbMinusB dflags0
   = do  { (am_installed, top_dir) <- findTopDir mbMinusB
                 -- top_dir
                 --      for "installed" this is the root of GHC's support files
@@ -193,8 +193,6 @@ initSysTools mbMinusB _
                 | am_installed = installed_bin "bin/windres"
                 | otherwise    = "windres"
 
-        ; let dflags0 = defaultDynFlags
-
         ; tmpdir <- getTemporaryDirectory
         ; let dflags1 = setTmpDir tmpdir dflags0