Re: A flaw in dep generation with gcc -MMD?
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Nov 18, 2011, 14:12 UTC
- Message-ID
- <CACsJy8CKmjq01KoLRzOnnaf6RwFCQJfjxziqKTZW9HDyd8CagA@mail.gmail.com>
- In-Reply-To
- <CACsJy8BuCdT3rRjc5u6Ex5RRgSbL_0SFF0GW-dTGqet4sG2cwg@mail.gmail.com>
On Fri, Nov 18, 2011 at 6:34 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> OK it's not gcc problem. I upgraded to 4.5.3 and still had the same > problem. I used ccache though. Without ccache, gcc produced correct > .o.d files.
"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.
Not sure if I should report this to ccache or gcc. In the meantime, may be we should recognize the situation and switch off COMPUTE_HEADER_DEPENDENCIES when ccache is used (maybe hard).
-- Duy