From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 14F4C1581E7 for ; Thu, 25 Apr 2024 15:46:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 212EAE29F8; Thu, 25 Apr 2024 15:45:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 9BF3EE29F1 for ; Thu, 25 Apr 2024 15:45:44 +0000 (UTC) From: Alfredo Tupone To: gentoo-dev@lists.gentoo.org, toolchain@gentoo.org Subject: [gentoo-dev] [PATCH 3/3] A check that the compiler used to build ada is ada and not newer Date: Thu, 25 Apr 2024 17:44:07 +0200 Message-ID: <20240425154537.32502-3-tupone@gentoo.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240425154537.32502-1-tupone@gentoo.org> References: <20240425154537.32502-1-tupone@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 7b5cd491-1a00-4be8-ae6b-c19fbabfe325 X-Archives-Hash: 395169f21b597daffc2d297f791d289e Maybe a more detailed check can be done, as some version can be built with newer compiler Could be envisaged to switch the compiler automatically "gcc-config x" instead of die Signed-off-by: Alfredo Tupone --- eclass/toolchain.eclass | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index f8e06fa39884..ce665b3c594b 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -540,30 +540,42 @@ get_gcc_src_uri() { echo "${GCC_SRC_URI}" } SRC_URI=$(get_gcc_src_uri) #---->> pkg_pretend <<---- toolchain_pkg_pretend() { if ! _tc_use_if_iuse cxx ; then _tc_use_if_iuse go && \ ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' _tc_use_if_iuse objc++ && \ ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' fi + if _tc_use_if_iuse ada ; then + if ! _tc_use_if_iuse cxx ; then + ewarn 'Ada requires a C++ compiler, disabled due to USE="-cxx"' + else + prevAdaSLOT=$(gnatmake -v 2>&1 | sed -n '2 p' | sed 's:^[^0-9]*\([0-9]\+\).*:\1:' | sed 's:2021:10:' ) + if [[ -z "${prevAdaSLOT}" ]] ; then + die 'Ada requires an Ada compiler' + elif [[ ${SLOT} -lt ${prevAdaSLOT} ]] ; then + die 'Ada cannot be built with a newer compiler' + fi + fi + fi } #---->> pkg_setup <<---- toolchain_pkg_setup() { # We don't want to use the installed compiler's specs to build gcc unset GCC_SPECS # bug #265283 unset LANGUAGES # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html # Avoid really confusing logs from subconfigure spam, makes logs far # more legible. MAKEOPTS="--output-sync=line ${MAKEOPTS}" -- 2.43.2