[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite loop bug with parallel make

From: Ian Lynagh
Subject: Re: Infinite loop bug with parallel make
Date: Sat, 23 Feb 2013 13:50:38 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Feb 22, 2013 at 09:38:22PM -0500, Paul Smith wrote:
> On Sat, 2013-02-23 at 02:32 +0000, Ian Lynagh wrote:
> > The problem was that our compiler generates 2 output files (foo.o and
> > foo.hi) when compiling one source file, and we had thus ended up with
> > a bunch of rules like
> >     %.hi: %.o ;
> The right way to declare a rule that generates multiple targets is:
>    %.o %.hi : %.c
>           ...
> In particular this won't break things when parallel builds are involved.
> Is there some reason that doesn't work for you?

We wrote this part of the build system some time ago, and didn't write
down the reason, so I can't be sure, but I can think of 2 possibilities:

1) As Shachar said, we might not have realised the difference between
   the way these two work:
    a b : c
    %a %b : %c
   (we'd certainly run into problems using the former in the past,
   before we realised what such a rule meant).

2) The .hi file contains the interface for the compiled code. If you
   change the source file and recompile, but the change doesn't alter
   the interface, then the compiler won't touch the .hi file, leaving it
   apparently looking out-of-date. (the reason it does this is so that
   it can tell whether recompilation of other files that depend on this
   one is necessary). I think that in that circumstance, a rule such as
   you suggest would run the compiler again every time you type "make",
   as the .hi file would appear to be out of date.

   If that is the reason then we might be able to work around it. Also,
   the interface file now includes a hash of the interface, so we might
   be able to use that instead of the timestamp, so this problem might
   have disappeared.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]