X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2FMain.hs;h=0ef217328331a420ff24fc5376188d2474a32326;hp=c80ca78a8084cd36e21da7c68b1097098cbe00bd;hb=f7d457cd1f89e056b0b43106f1ae7508a399cb40;hpb=1bc059870916339b3caac3514b28398ff9a588a2 diff --git a/ghc/Main.hs b/ghc/Main.hs index c80ca78..0ef2173 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -261,7 +261,7 @@ checkOptions cli_mode dflags srcs objs = do when (notNull (filter isRTSWay (wayNames dflags)) && isInterpretiveMode cli_mode) $ - putStrLn ("Warning: -debug, -threaded and -ticky are ignored by GHCi") + hPutStrLn stderr ("Warning: -debug, -threaded and -ticky are ignored by GHCi") -- -prof and --interactive are not a good combination when (notNull (filter (not . isRTSWay) (wayNames dflags)) @@ -280,9 +280,14 @@ checkOptions cli_mode dflags srcs objs = do then ghcError (UsageError "can't apply -o to multiple source files") else do + let not_linking = not (isLinkMode cli_mode) || isNoLink (ghcLink dflags) + + when (not_linking && not (null objs)) $ + hPutStrLn stderr ("Warning: the following files would be used as linker inputs, but linking is not being done: " ++ unwords objs) + -- Check that there are some input files -- (except in the interactive case) - if null srcs && null objs && needsInputsMode cli_mode + if null srcs && (null objs || not_linking) && needsInputsMode cli_mode then ghcError (UsageError "no input files") else do @@ -360,6 +365,8 @@ needsInputsMode _ = False isLinkMode :: CmdLineMode -> Bool isLinkMode (StopBefore StopLn) = True isLinkMode DoMake = True +isLinkMode DoInteractive = True +isLinkMode (DoEval _) = True isLinkMode _ = False isCompManagerMode :: CmdLineMode -> Bool