commit:     258a44f3500383f7948781d463652b6d79aa7c06
Author:     Andrei Horodniceanu <a.horodniceanu <AT> proton <DOT> me>
AuthorDate: Fri Oct  4 05:04:47 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  7 04:12:41 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=258a44f3

toolchain.eclass: Print an error message and die if GDC isn't found

When cross compiling sys-devel/gcc[d] one would need
cross-${CHOST}/gcc[d] installed. We can't enforce this dependency so
defer to printing an error message if it can't be found prompting the
user to install the package.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu <AT> proton.me>
Closes: https://github.com/gentoo/gentoo/pull/38894
Signed-off-by: Sam James <sam <AT> gentoo.org>

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

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ff02723e2d90..34f595bcd1bc 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1032,9 +1032,24 @@ toolchain_setup_d() {
                eend 1
        done
 
-       if [[ -n ${d_bootstrap} ]] ; then
-               export GDC=${gcc_bin_base}/${d_bootstrap}/${CHOST}-gdc
+       if [[ -z ${d_bootstrap} ]] ; then
+               if tc-is-cross-compiler ; then
+                       # We can't add cross-${CHOST}/gcc[d] to BDEPEND but we 
can
+                       # print a useful message to the user.
+                       eerror "No ${gcc_pkg}[d] was found installed."
+                       eerror "When cross-compiling GDC a bootstrap GDC is 
required."
+                       eerror "Either disable the d USE flag or add:"
+                       eerror ""
+                       eerror "    ${gcc_pkg} d"
+                       eerror ""
+                       eerror "In your package.use and re-emerge it."
+                       eerror ""
+               fi
+
+               die "Did not find any appropriate GDC compiler installed"
        fi
+
+       export GDC=${gcc_bin_base}/${d_bootstrap}/${CHOST}-gdc
 }
 
 #---->> src_configure <<----

Reply via email to