smart relinking bug
Simon Marlow
simonmarhaskell at gmail.com
Mon Oct 23 07:30:03 EDT 2006
Lemmih wrote:
> On 10/21/06, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
>
>> Hello Lemmih,
>>
>> Saturday, October 21, 2006, 8:11:02 PM, you wrote:
>>
>> >> gcc -c -o a.o a.c
>> >> ghc --make Main.hs a.o
>> >>
>> >> this command incorrectly don't relinks executable if a.c was changed
>> >> but Main.hs wasn't
>>
>> > Did you mean a.o instead of a.c?
>>
>> if a.c changes then first line will recompile it and change a.o too :)
>> for '--make' command a.o will be changed and main.hs remains old
>
>
> Ah, I didn't read the two lines as a single command.
>
> I think adding something like this to DriverPipeline should fix it:
>
> extra_ld_inputs <- readIORef v_Ld_inputs
> extra_times <- mapM (IO.try . getModificationTime) extra_ld_inputs)
> let linking_needed
> | Left _ <- e_exe_time = True
> | Right t <- e_exe_time =
> any (t <) (map linkableTime linkables) ||
> any (t <) [ t' | Right t' <- extra_times ]
Looks good - you can simplify with a ++ instead of the ||, though.
Cheers,
Simon
More information about the Glasgow-haskell-bugs
mailing list