summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-09-25 01:05:20 +0100
committerSam James <sam@gentoo.org>2023-09-25 03:06:51 +0100
commit6302dd47e23ee32cfcb446355704ba8bc61b668e (patch)
treee807420d8144d3ba78d6b95b21bbb01de31aee39 /eclass
parentapp-arch/lunzip: Stabilize 1.13 amd64, #914607 (diff)
downloadgentoo-6302dd47e23ee32cfcb446355704ba8bc61b668e.tar.gz
gentoo-6302dd47e23ee32cfcb446355704ba8bc61b668e.tar.bz2
gentoo-6302dd47e23ee32cfcb446355704ba8bc61b668e.zip
toolchain.eclass: fix should_we_gcc_config for major-version slotting
Reported by the-horo on IRC. For example, with slot as major version: ``` $ gcc-config -c x86_64-pc-linux-gnu x86_64-pc-linux-gnu-13 $ gcc-config -S x86_64-pc-linux-gnu-13 x86_64-pc-linux-gnu 13 ``` so we're indeed comparing 13 with 13.2 and hence we decide to run gcc-config unnecessarily because we think it's a major version change. Fix that by taking into account tc_use_major_version_only and comparing based on GCCMAJOR for that case. Bug: https://bugs.gentoo.org/865835 Bug: https://bugs.gentoo.org/873505 Reported-by: the-horo Closes: https://github.com/gentoo/gentoo/pull/33042 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass4
1 files changed, 3 insertions, 1 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 6a88676b750d..d93068619cf9 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2244,7 +2244,9 @@ should_we_gcc_config() {
local curr_branch_ver=$(ver_cut 1-2 ${curr_config_ver})
- if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then
+ if tc_use_major_version_only && [[ ${curr_config_ver} == ${GCCMAJOR} ]] ; then
+ return 0
+ elif ! tc_use_major_version_only && [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then
return 0
else
# If we're installing a genuinely different compiler version,