[ccache] Incorrect dependency file with intel compilers.

Ramiro Polla ramiro.polla at gmail.com
Sat Jul 10 00:27:12 MDT 2010


Hi,

Using Intel's C++ compiler[1] with ccache generates bad dependency
files. Instead of taking the proper dependency file generated by the
preprocessor, it takes a second dependency file generated by the
compiler using the temporary .i file (which is listed as the only
dependency). For example:
$ echo > test.c
$ ia32-icc -o test.o -MMD -c test.c
$ cat test.d
test.o: test.c
$ ccache ia32-icc -o test.o -MMD -c test.c
$ cat test.d
test.o: /export/ramiro/.ccache/tmp/test.tmp.entropy.9165.i

The log file generated (timestamps stripped):

=== CCACHE STARTED =========================================
Hostname: entropy
Working directory: /export/ramiro/ffmpeg/ia32-icc
Source file: test.c
Dependency file: test.d
Object file: test.o
Trying direct lookup
Looking for object file hash in
/export/ramiro/.ccache/8/d/12eace3c8eec1d7c59c5f9f5049d04-203.manifest
Did not find object file hash in manifest
Running preprocessor
Executing /export/ramiro/intel/Compiler/11.1/072/bin/ia32-icc -MMD -c
-MF test.d -MT test.o -E test.c
Got object file hash from preprocessor
Preprocessor created test.d
Object file /export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.o
not in cache
Running real compiler
Executing /export/ramiro/intel/Compiler/11.1/072/bin/ia32-icc -MMD -c
-MF test.d -MT test.o -o
/export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.o.tmp.entropy.9165
/export/ramiro/.ccache/tmp/test.tmp.entropy.9165.i
Stored in cache: /export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.o
Copying /export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.o
to test.o (uncompressed)
Created test.o from
/export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.o
Copying test.d to
/export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.d
(uncompressed)
Stored in cache: /export/ramiro/.ccache/2/d/359790b43e0c721baa2cb798095505-204.d
Added object file hash to
/export/ramiro/.ccache/8/d/12eace3c8eec1d7c59c5f9f5049d04-203.manifest

The dependency file generated by the preprocessor (the one in line
"Preprocessor created test.d") is correct. Is it not possible to keep
that dependency file instead, and possibly also remove the -MMD & co
arguments from "Running real compiler"?

Ramiro Polla
[1] http://software.intel.com/en-us/articles/non-commercial-software-download/


More information about the ccache mailing list