X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=447dd28c57333bddc6440b7755b416cad828d61e;hb=169f5972d5398e75c4cf7f831b6ce703288ec73c;hp=b00424c8c78a8bb64a1912e7a0d74e6683fe080e;hpb=22294cdadb1ebb72aaffe3922010b810fec0530d;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index b00424c..447dd28 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -17,6 +17,7 @@ module DynFlags ( DOpt(..), DynFlag(..), ExtensionFlag(..), + glasgowExtsFlags, flattenExtensionFlags, ensureFlattenedExtensionFlags, lopt_set_flattened, @@ -60,7 +61,12 @@ module DynFlags ( -- * Compiler configuration suitable for display to the user Printable(..), - compilerInfo, rtsIsProfiled + compilerInfo +#ifdef GHCI +-- Only in stage 2 can we be sure that the RTS +-- exposes the appropriate runtime boolean + , rtsIsProfiled +#endif ) where #include "HsVersions.h" @@ -595,7 +601,6 @@ defaultObjectTarget data DynLibLoader = Deployable - | Wrapped (Maybe String) | SystemDependent deriving Eq @@ -927,9 +932,6 @@ parseDynLibLoaderMode f d = case splitAt 8 f of ("deploy", "") -> d{ dynLibLoader = Deployable } ("sysdep", "") -> d{ dynLibLoader = SystemDependent } - ("wrapped", "") -> d{ dynLibLoader = Wrapped Nothing } - ("wrapped:", "hard") -> d{ dynLibLoader = Wrapped Nothing } - ("wrapped:", flex) -> d{ dynLibLoader = Wrapped (Just flex) } _ -> ghcError (CmdLineError ("Unknown dynlib loader: " ++ f)) setDumpPrefixForce f d = d { dumpPrefixForce = f} @@ -1809,12 +1811,13 @@ glasgowExtsFlags = [ , Opt_GeneralizedNewtypeDeriving , Opt_TypeFamilies ] +#ifdef GHCI -- Consult the RTS to find whether GHC itself has been built profiled -- If so, you can't use Template Haskell foreign import ccall unsafe "rts_isProfiled" rtsIsProfiledIO :: IO CInt rtsIsProfiled :: Bool -rtsIsProfiled = False -- unsafePerformIO rtsIsProfiledIO /= 0 +rtsIsProfiled = unsafePerformIO rtsIsProfiledIO /= 0 checkTemplateHaskellOk :: Bool -> DynP () checkTemplateHaskellOk turn_on @@ -1822,6 +1825,12 @@ checkTemplateHaskellOk turn_on = addErr "You can't use Template Haskell with a profiled compiler" | otherwise = return () +#else +-- In stage 1 we don't know that the RTS has rts_isProfiled, +-- so we simply say "ok". It doesn't matter because TH isn't +-- available in stage 1 anyway. +checkTemplateHaskellOk turn_on = return () +#endif {- ********************************************************************** %* *