diff options
author | Sam James <sam@gentoo.org> | 2022-09-29 23:12:12 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-09-29 23:35:57 +0100 |
commit | 3e49f724d090d65b739be1a67f6c40574337a2f7 (patch) | |
tree | bc8895dc704874167426f514582485e2b063ba64 | |
parent | gcc-config: improve language (diff) | |
download | gcc-config-3e49f724d090d65b739be1a67f6c40574337a2f7.tar.gz gcc-config-3e49f724d090d65b739be1a67f6c40574337a2f7.tar.bz2 gcc-config-3e49f724d090d65b739be1a67f6c40574337a2f7.zip |
gcc-config: set CCACHE_COMPILERCHECK to major GCC version
This avoids invalidating caches on every GCC snapshot bump for the same
major version (e.g. 12.2.1_p*), but also for 12.1 -> 12.2. It should be fine
to mix objects between such versions.
If needed, we can swap this to just stripping .1_p* but that's a bit
more awkward.
Bug: https://bugs.gentoo.org/872971
Signed-off-by: Sam James <sam@gentoo.org>
-rwxr-xr-x | gcc-config | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -747,6 +747,14 @@ switch_profile() { echo "LDPATH=\"${MY_LDPATH}\"" >> "${envd}.tmp" fi + # Avoid ccache cache invalidations where possible between + # snapshots and minor GCC versions, bug #872971. + # For GCC 10, we changed the slotting from e.g. 10.4 -> 10. + local gcc_major_version="${CC_COMP_VERSION%%.*}" + if [[ "${gcc_major_version}" -ge 10 ]] ; then + echo "CCACHE_COMPILERCHECK=\"string:gcc-${gcc_major_version}\"" >> "${envd}.tmp" + fi + # Punt old files; maybe globs too much, but oh well # 'NATIVE' and '.NATIVE' were used by gcc-wrapper before Aug 2018 # and are not used as wrapper is removed. |