From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1674739-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 2D7CB15808B
	for <garchives@archives.gentoo.org>; Sun, 29 Sep 2024 11:22:06 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DEE8DE2A2A;
	Sun, 29 Sep 2024 11:22:04 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C9993E2A2A
	for <gentoo-commits@lists.gentoo.org>; Sun, 29 Sep 2024 11:22:04 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 192CF343231
	for <gentoo-commits@lists.gentoo.org>; Sun, 29 Sep 2024 11:22:04 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 76A3E1F43
	for <gentoo-commits@lists.gentoo.org>; Sun, 29 Sep 2024 11:22:02 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1727608886.d1aa56b6e39f07490021e594920f4a965a968c07.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
X-VCS-Repository: repo/gentoo
X-VCS-Files: eclass/toolchain.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: d1aa56b6e39f07490021e594920f4a965a968c07
X-VCS-Branch: master
Date: Sun, 29 Sep 2024 11:22:02 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 09d49d2d-e885-4a75-9e9b-a4dc97543f93
X-Archives-Hash: 8748bb5710c57f97811a9a77159e6478

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"