[ccache] wrong object returned from cache

Ladyofthe Maple dmaple2012 at yahoo.com
Sat Jul 8 15:23:43 UTC 2017

I am seeing an odd issue with ccache 3.3.3 on OS X, installed via brew.
I have a host with SSD, 24 CPU cores, OS X 10.12.4.I am starting 4 builds, make driven.  Each build is being allowed to start 8 jobs (-j8).From time to time I am seeing an issue where the linker reports an object file returned needs a function which is missing BUT, there is no way that code is even being enabled given the C flags I am using.  I compiled the code and check the preprocessor output in a local workspace and the generated file looks correct, i.e. the function is not being used in the generated file.
There isn't any disk corruption.  I am NOT using hard links in the cache.The cache directory IS shared.
This seems like some sort of locking issue between the processes accessing the cache as one or more of the builds may be compiling a version with the section of code where the function is used while another is not.
The compiler is clang btw.
Are there any options I should be passing / setting for CCACHE in my use case ?
I am seeing this issue on multiple build nodes.
I see CCACHE uses file locking, is it written properly to work for OS X ?
I'm at a bit of a loss as to what is causing this issue.   When ccache works properly it improves my build times by 2x or more.   When it fails, it fails in weird ways I don't understand.
Thank you for your insight and comments.

More information about the ccache mailing list