commit:     94e1da124cc8a5cf461eb5cc148fa1d429ff3ac0
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Sun Aug 31 22:40:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 23 17:32:12 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=94e1da12

gcc-config: fix cross-compiler detection

Compiler can be missdetected as native compiler if CHOST is a
substring of CTARGET.

Bug: https://bugs.gentoo.org/962211
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Part-of: https://github.com/gentoo/gcc-config/pull/6
Closes: https://github.com/gentoo/gcc-config/pull/6
Signed-off-by: Sam James <sam <AT> gentoo.org>

 gcc-config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc-config b/gcc-config
index 07726af..f1885f4 100755
--- a/gcc-config
+++ b/gcc-config
@@ -182,7 +182,7 @@ get_chost() {
 }
 
 is_cross_compiler() {
-       [[ ${CC_COMP/${CHOST}} == ${CC_COMP} ]]
+       [[ ${CHOST} != ${CC_COMP_TARGET} ]]
 }
 
 is_same_mountpoint() {

Reply via email to