summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2022-10-25 21:28:04 +0200
committerJoel Rosdahl <joel@rosdahl.net>2022-10-26 07:47:19 +0200
commit14ef97907211bb78ae8826b218e5a82cb29ae67b (patch)
treeed9aff7daa554f262d0bc24e3c276f64daaa6c08
parent24dc4c99a37a8f016504cdbedf2bfdd707fe30dd (diff)
downloadccache-14ef97907211bb78ae8826b218e5a82cb29ae67b.tar.gz
fix: Use separate 32-bit and 64-bit inode cache files
The memory layout of the shared region differs between 32-bit and 64-bit ccache binaries, so use different inode cache files.
-rw-r--r--src/InodeCache.cpp4
-rw-r--r--test/suites/inode_cache.bash2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/InodeCache.cpp b/src/InodeCache.cpp
index df928d4f..5985cd5b 100644
--- a/src/InodeCache.cpp
+++ b/src/InodeCache.cpp
@@ -498,7 +498,9 @@ InodeCache::drop()
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
diff --git a/test/suites/inode_cache.bash b/test/suites/inode_cache.bash
index a09ac5d7..e53bf8b2 100644
--- a/test/suites/inode_cache.bash
+++ b/test/suites/inode_cache.bash
@@ -9,7 +9,7 @@ SUITE_inode_cache_PROBE() {
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