Re: A flaw in dep generation with gcc -MMD?
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Nov 18, 2011, 21:16 UTC
- Message-ID
- <20111118211645.GA27440@elie.hsd1.il.comcast.net>
- In-Reply-To
- <loom.20111118T191851-152@post.gmane.org>
Hi,
(restoring cc list. Unfortunately gmane's web interface doesn't provide a built-in way to reply-to-all. [1] has a hackish workaround.) Samuel Bronson wrote:
> Nguyen Thai Ngoc Duy writes:
Show 5 quoted lines
>> "gcc -MF depfile -MMD -MP -c -o path/to/file.o" will produce "depfile" >> with target given by "-o". When ccache runs, it executes "gcc -MF >> depfile -MMD -MP -E" instead to get the final content for hashing. >> Notice that "-c -o" combination is replaced by "-E". The latter >> produces target without leading path.
[...]
> I'm pretty sure you should report this against ccache; GCC seems to be > behaving as documented.
Seems to have been fixed by v3.0pre0~187:
commit e8354384 Author: Andrea Bittau <a.bittau@cs.ucl.ac.uk> Date: Sun Nov 1 19:39:58 2009 +0100
Fix handling of the -MD and -MDD options
From <http://lists.samba.org/archive/ccache/2007q2/000272.html>:
The -MD and -MDD options automatically determine where the dependency file
should land and what the target should look like based on the -o option.
However, ccache drops -o and things mess up. The original patch was posted by
Kaz Kylheku but I reworked it to make it work properly. Here is his post:http://lists.samba.org/archive/ccache/2006q4/000249.html
Workaround incoming in a few moments.
Thanks, Jonathan