The memory layout of the shared region differs between 32-bit and 64-bit
ccache binaries, so use different inode cache files.
std::string
InodeCache::get_file()
{
- return FMT("{}/inode-cache.v{}", m_config.temporary_dir(), k_version);
+ const uint8_t arch_bits = 8 * sizeof(void*);
+ return FMT(
+ "{}/inode-cache-{}.v{}", m_config.temporary_dir(), arch_bits, k_version);
}
int64_t
touch test.c
$CCACHE $COMPILER -c test.c
- if [[ ! -f "${CCACHE_TEMPDIR}/inode-cache.v1" ]]; then
+ if [[ ! -f "${CCACHE_TEMPDIR}/inode-cache-32.v1" && ! -f "${CCACHE_TEMPDIR}/inode-cache-64.v1" ]]; then
local fs_type=$(stat -fLc %T "${CCACHE_DIR}")
echo "inode cache not supported on ${fs_type}"
fi