Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gcc-config:master commit in: /
Date: Thu, 29 Sep 2022 22:36:06
Message-Id: 1664490957.3e49f724d090d65b739be1a67f6c40574337a2f7.sam@gentoo
1 commit: 3e49f724d090d65b739be1a67f6c40574337a2f7
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 29 22:12:12 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 29 22:35:57 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=3e49f724
7
8 gcc-config: set CCACHE_COMPILERCHECK to major GCC version
9
10 This avoids invalidating caches on every GCC snapshot bump for the same
11 major version (e.g. 12.2.1_p*), but also for 12.1 -> 12.2. It should be fine
12 to mix objects between such versions.
13
14 If needed, we can swap this to just stripping .1_p* but that's a bit
15 more awkward.
16
17 Bug: https://bugs.gentoo.org/872971
18 Signed-off-by: Sam James <sam <AT> gentoo.org>
19
20 gcc-config | 8 ++++++++
21 1 file changed, 8 insertions(+)
22
23 diff --git a/gcc-config b/gcc-config
24 index 44a3869..dfc01d0 100755
25 --- a/gcc-config
26 +++ b/gcc-config
27 @@ -747,6 +747,14 @@ switch_profile() {
28 echo "LDPATH=\"${MY_LDPATH}\"" >> "${envd}.tmp"
29 fi
30
31 + # Avoid ccache cache invalidations where possible between
32 + # snapshots and minor GCC versions, bug #872971.
33 + # For GCC 10, we changed the slotting from e.g. 10.4 -> 10.
34 + local gcc_major_version="${CC_COMP_VERSION%%.*}"
35 + if [[ "${gcc_major_version}" -ge 10 ]] ; then
36 + echo "CCACHE_COMPILERCHECK=\"string:gcc-${gcc_major_version}\"" >> "${envd}.tmp"
37 + fi
38 +
39 # Punt old files; maybe globs too much, but oh well
40 # 'NATIVE' and '.NATIVE' were used by gcc-wrapper before Aug 2018
41 # and are not used as wrapper is removed.