X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=b067782242ba004a8227683fd188efb866315a01;hp=2e7e1feda6e80e9352f83a54ce279c72f8be0e76;hb=5cd20c4026ffecda7822979b7de87e6a6a6fef20;hpb=fd316eba4747cf8bb9381e06c7afc3c024e1e5c1 diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 2e7e1fe..b067782 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -61,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" @@ -1810,12 +1815,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 @@ -1823,6 +1829,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 {- ********************************************************************** %* *