]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Use separate 32-bit and 64-bit inode cache files
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 25 Oct 2022 19:28:04 +0000 (21:28 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 26 Oct 2022 05:47:19 +0000 (07:47 +0200)
The memory layout of the shared region differs between 32-bit and 64-bit
ccache binaries, so use different inode cache files.

src/InodeCache.cpp
test/suites/inode_cache.bash

index df928d4fdca9947e6a1fe24e5ee8375ca04fc9b3..5985cd5b612c4d3a94041b10a183280899152432 100644 (file)
@@ -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
index a09ac5d789cda9d9579327f5337feb52d51e1682..e53bf8b20b00d8c20fec449d0f5887387d970fed 100644 (file)
@@ -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