diff options
author | Ian Lynagh <igloo@earth.li> | 2007-09-23 18:16:20 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2007-09-23 18:16:20 +0000 |
commit | b17eae42ad936fd88ddcc356ba876e8a0910d46b (patch) | |
tree | 758e28bc997359d6cd3cd4793426e02b893ab74b /compiler | |
parent | b9f6e4bbf09f7bc003fc1ea3cc5800609b2f99d0 (diff) | |
download | haskell-b17eae42ad936fd88ddcc356ba876e8a0910d46b.tar.gz |
Notice when C modules have changed when deciding whether or not to link
Based on a patch from Lemmih
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/DriverPipeline.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index c0595f9ffb..22ce8c4324 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -304,10 +304,13 @@ link LinkBinary dflags batch_attempt_linking hpt -- modification times on all of the objects, then omit linking -- (unless the -no-recomp flag was given). e_exe_time <- IO.try $ getModificationTime exe_file - let linking_needed + extra_ld_inputs <- readIORef v_Ld_inputs + extra_times <- mapM (IO.try . getModificationTime) extra_ld_inputs + let other_times = map linkableTime linkables + ++ [ t' | Right t' <- extra_times ] + linking_needed | Left _ <- e_exe_time = True - | Right t <- e_exe_time = - any (t <) (map linkableTime linkables) + | Right t <- e_exe_time = any (t <) other_times if not (dopt Opt_ForceRecomp dflags) && not linking_needed then do debugTraceMsg dflags 2 (text exe_file <+> ptext SLIT("is up to date, linking not required.")) |