commit:     681d39425a71977ba0850eb88448f831f84dd6eb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 14:07:23 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 14:07:23 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=681d3942

Revert "gcc-config: set CCACHE_COMPILERCHECK to major GCC version"

This isn't going to work where the compiler used is Clang but GCC
is installed -- we'll end up always using a cache key of the
major GCC version, even for say, different Clang versions.

Fortunately, using %compiler% -dumpversion instead of %compiler% -v
locally will handle it fine as a workaround (to be set in ccache.conf) because
since  b7a62d5e3f5e6e05c929f225ead22a2981c9f64 in gentoo.git, GCC installs
with just the major version in its paths, and -dumpversion reports said
major version, not the whole version (can use gcc -dumpfullversion if needed).

This reverts commit 3e49f724d090d65b739be1a67f6c40574337a2f7.

Bug: https://bugs.gentoo.org/872971
Signed-off-by: Sam James <sam <AT> gentoo.org>

 gcc-config | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/gcc-config b/gcc-config
index 31a7f4a..08002fd 100755
--- a/gcc-config
+++ b/gcc-config
@@ -747,14 +747,6 @@ 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.

Reply via email to