Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/07f6af72215bea70ad95c6b1278ed927cd9693e4

>---------------------------------------------------------------

commit 07f6af72215bea70ad95c6b1278ed927cd9693e4
Author: Simon Marlow <[email protected]>
Date:   Wed Nov 16 15:51:44 2011 +0000

    Give a warning when -rtsopts/-with-rtsopts are used with -no-hs-main

>---------------------------------------------------------------

 compiler/main/DriverPipeline.hs |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 8103f66..aaf9f00 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1446,6 +1446,15 @@ mkExtraObjToLinkIntoBinary :: DynFlags -> [PackageId] -> 
IO FilePath
 mkExtraObjToLinkIntoBinary dflags dep_packages = do
    link_info <- getLinkInfo dflags dep_packages
 
+   let have_rts_opts_flags =
+         isJust (rtsOpts dflags) || case rtsOptsEnabled dflags of
+                                        RtsOptsSafeOnly -> False
+                                        _ -> True
+
+   when (dopt Opt_NoHsMain dflags && have_rts_opts_flags) $ do
+      hPutStrLn stderr $ "Warning: -rtsopts and -with-rtsopts have no effect 
with -no-hs-main.\n" ++
+                         "    Call hs_init_ghc() from your main() function to 
set these options."
+
    mkExtraCObj dflags (showSDoc (vcat [main,
                                        link_opts link_info]
                                    <> char '\n')) -- final newline, to



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to