bug-make
[Top][All Lists]
Advanced

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

Re: Infinite loop bug with parallel make


From: Shachar Shemesh
Subject: Re: Infinite loop bug with parallel make
Date: Sat, 23 Feb 2013 06:57:27 +0200
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

On 02/23/2013 04:38 AM, 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?

One caveat to note if implementing Paul's suggestion is that multiple target rules behave differently for pattern vs. non-pattern rules.

For pattern rules, what Paul said is 100% correct, and should solve your problem. However, if you write a rule that says:
foo.o foo.hi: foo.c
            ...

It means something quite different. That means that the same rule builds both foo.c and foo.hi. In parallel build, that might cause make to run the rule twice.

What I'm also interested in is why .SECONDARY made everything slow.

Shachar

-- 
Shachar Shemesh

reply via email to

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