summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-10-06 13:55:26 +0100
committerSam James <sam@gentoo.org>2022-10-06 13:55:26 +0100
commit7b7a62d5e3f5e6e05c929f225ead22a2981c9f64 (patch)
tree3b3642ae6aa9b83891437e5d074c794dee3c2a05
parentprofiles/features/musl: consolidate sys-apps/tas into binary glibc mask (diff)
downloadgentoo-7b7a62d5e3f5e6e05c929f225ead22a2981c9f64.tar.gz
gentoo-7b7a62d5e3f5e6e05c929f225ead22a2981c9f64.tar.bz2
gentoo-7b7a62d5e3f5e6e05c929f225ead22a2981c9f64.zip
toolchain.eclass: use --with-major-version-only for newer install paths
Flip over to major version install paths to reflect the change in slotting we made between 9 and 10. We only slot major versions now, so we should have our install paths reflect that for: 1. principle of least surprise; 2. we want LDPATH to remain valid between upgrades (bug #865835, bug #873505). Bug: https://bugs.gentoo.org/865835 Bug: https://bugs.gentoo.org/873505 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/27533 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--eclass/toolchain.eclass37
1 files changed, 36 insertions, 1 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 71342765c78e..62977f16309f 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -57,6 +57,7 @@ is_crosscompile() {
[[ ${CHOST} != ${CTARGET} ]]
}
+
# @FUNCTION: tc_version_is_at_least
# @USAGE: ver1 [ver2]
# @DESCRIPTION:
@@ -138,6 +139,32 @@ GCCMINOR=$(ver_cut 2 ${GCC_PV})
# GCC micro version.
GCCMICRO=$(ver_cut 3 ${GCC_PV})
+tc_use_major_version_only() {
+ local use_major_version_only=0
+
+ if ! tc_version_is_at_least 10 ; then
+ return 1
+ fi
+
+ if [[ ${GCCMAJOR} -eq 10 ]] && ver_test ${PV} -ge 10.4.1_p20220929 ; then
+ use_major_version_only=1
+ elif [[ ${GCCMAJOR} -eq 11 ]] && ver_test ${PV} -ge 11.3.1_p20220930 ; then
+ use_major_version_only=1
+ elif [[ ${GCCMAJOR} -eq 12 ]] && ver_test ${PV} -ge 12.2.1_p20221001 ; then
+ use_major_version_only=1
+ elif [[ ${GCCMAJOR} -eq 13 ]] && ver_test ${PV} -ge 13.0.0_pre20221002 ; then
+ use_major_version_only=1
+ elif [[ ${GCCMAJOR} -gt 13 ]] ; then
+ use_major_version_only=1
+ fi
+
+ if [[ ${use_major_version_only} -eq 1 ]] ; then
+ return 0
+ fi
+
+ return 1
+}
+
# @ECLASS_VARIABLE: GCC_CONFIG_VER
# @INTERNAL
# @DESCRIPTION:
@@ -145,7 +172,11 @@ GCCMICRO=$(ver_cut 3 ${GCC_PV})
# of binary and gcc-config names not directly tied to upstream
# versioning. In practice it's hard to untangle from gcc/BASE-VER
# (GCC_RELEASE_VER) value.
-GCC_CONFIG_VER=${GCC_RELEASE_VER}
+if tc_use_major_version_only ; then
+ GCC_CONFIG_VER=${GCCMAJOR}
+else
+ GCC_CONFIG_VER=${GCC_RELEASE_VER}
+fi
# Pre-release support. Versioning schema:
# 1.0.0_pre9999: live ebuild
@@ -1006,6 +1037,10 @@ toolchain_src_configure() {
--with-pkgversion="${BRANDING_GCC_PKGVERSION}"
)
+ if tc_use_major_version_only ; then
+ confgcc+=( --with-gcc-major-version-only )
+ fi
+
# If we want hardened support with the newer PIE patchset for >=gcc 4.4
if tc_version_is_at_least 4.4 && want_minispecs && in_iuse hardened ; then
confgcc+=( $(use_enable hardened esp) )