commit:     d1aa56b6e39f07490021e594920f4a965a968c07
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 11:20:08 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 11:21:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1aa56b6

toolchain.eclass: start with oldest GDC and work upwards instead

Per https://gcc.gnu.org/install/prerequisites.html
"""
It is strongly recommended to use an older version of GDC to build GDC.

More recent versions of GDC than the version built are not guaranteed to work
and will often fail during the build with compilation errors relating to
deprecations or removed features.
"""

... so do as I just did for GNAT.

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

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d68055f909fd..62ff83feed28 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1000,8 +1000,8 @@ toolchain_src_configure() {
                local d_candidate
                # We always prefer the version being built if possible
                # as it has the greatest chance of success. Failing that,
-               # try the latest installed GCC and iterate downwards.
-               for d_candidate in ${SLOT} $(seq ${latest_gcc} -1 10) ; do
+               # try GCC 10 and iterate upwards.
+               for d_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
                        has_version -b "sys-devel/gcc:${d_candidate}" || 
continue
 
                        ebegin "Testing sys-devel/gcc:${d_candidate} for D"

Reply via email to