[ccache] stat() versus gcc -v in the hash

Michael McTernan Michael.McTernan at ttpcom.com
Mon Jul 19 08:33:09 GMT 2004


The only problem with adding something like "gcc -v" is that it's specific
to the compiler (could be --v or -version etc...), and may also require the
compiler to be invoked twice (that or some cunning implementation tricks).
Getting info about the executable (mod time/size) seems like it would be
faster and also catch any case where the compiler was updated but the
version string unchanged (unlikely, unless you are developing the compiler
itself).  Realistically though, how often does the compiler executable get
touched without it really being updated?

Maybe an environment variable like CCACHE_TOOLID="-v" could be set to
indicate that the tools should be ran with a "-v" option instead of stating
the executable...  could be a nice patch.



> -----Original Message-----
> From: ccache-bounces+mm1=ttpcom.com at lists.samba.org
> [mailto:ccache-bounces+mm1=ttpcom.com at lists.samba.org]On Behalf Of M.
> Creidieki Crouch
> Sent: 19 July 2004 09:12
> To: ccache at lists.samba.org
> Subject: [ccache] stat() versus gcc -v in the hash
> Hi,
> I've been using ccache with my Gentoo system, and it's working really
> well.  The only problem I'm having is that whenever I recompile my
> system ("emerge --emptytree world"), the mtime of my compiler changes,
> and none of my cache seems to work, even if the compiler is the same
> version and was compiled with the same options.
> I looked through the code, and noticed that the date and size of the
> compiler are added to the hash.  Would it be possible to hash the
> output of "gcc -v" (or equivalent) instead?  I think that would make
> the detection of whether the compiler has changed more accurate, but
> I'm not sure.  I'd be happy to write a patch if it sounds like it
> would work.
> Thanks,
> M. Creidieki Crouch
> _______________________________________________
> ccache mailing list
> ccache at lists.samba.org
> http://lists.samba.org/mailman/listinfo/ccache

More information about the ccache mailing list