Re: A flaw in dep generation with gcc -MMD?
From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:52:30
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:
quoted
"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 [off-list ref]
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