commit:     d3984aa0c0c2e708244f87d61d89c74597203d33
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  8 08:01:03 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec  8 08:02:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3984aa0

toolchain.eclass: fixup cross-include checks

I have a feeling this may fix the issue we're working around in
37dded9b48c93a67b9a32b5eca2b1ef0fc6e8b9e, or maybe it's only needed
with USE=ada where we do some CC hacks.

This shows up with USE=valgrind since c1010ab3cf08a281deb47825f782dd8581bc3138
but it may well happen with the openmp check too.

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 4b90df79f0e7..959e86e5d972 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1738,7 +1738,7 @@ toolchain_src_configure() {
                # build without a C library, and you can't build that w/o
                # already having a compiler...
                if ! is_crosscompile || \
-                  $(tc-getCPP ${CTARGET}) -E - <<<"#include <pthread.h>" >& 
/dev/null
+                  $(unset CC; unset CPP; tc-getCPP ${CTARGET}) -E - 
<<<"#include <pthread.h>" >& /dev/null
                then
                        confgcc+=( $(use_enable openmp libgomp) )
                else
@@ -1801,7 +1801,7 @@ toolchain_src_configure() {
                # We patch this in w/ 
PR66487-object-lifetime-instrumentation-for-Valgrind.patch,
                # so it may not always be available.
                if grep -q -- '--enable-valgrind-interop' 
"${S}"/libgcc/configure.ac ; then
-                       if ! is_crosscompile || $(tc-getCPP ${CTARGET}) -E - 
<<<"#include <valgrind/memcheck.h>" >& /dev/null ; then
+                       if ! is_crosscompile || $(unset CC; unset CPP; 
tc-getCPP ${CTARGET}) -E - <<<"#include <valgrind/memcheck.h>" >& /dev/null ; 
then
                                confgcc+=( $(use_enable valgrind 
valgrind-interop) )
                        else
                                confgcc+=( --disable-valgrind-interop )

Reply via email to