From 24ea1d3f1968bff52ccaaf33fcdd59e810459aa9 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 9 Mar 2023 11:46:19 -0800 Subject: detect.py: Be more precise about detecting xtensa gcc toolchains clang --version can yield a string like below when its installed into such a directory clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9) Target: aarch64-yoe-linux Thread model: posix InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux as you can see InstallDir has 'xt-' subtring and this trips the check to guess gcc if 'Free Software Foundation' in out or 'xt-' in out: Therefore, check if compiler output starts with xt- then assume it to be gcc Signed-off-by: Khem Raj --- mesonbuild/compilers/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 1ef734f69..6eca15571 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -334,7 +334,7 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin version = search_version(out) guess_gcc_or_lcc: T.Optional[str] = None - if 'Free Software Foundation' in out or 'xt-' in out: + if 'Free Software Foundation' in out or out.startswith('xt-'): guess_gcc_or_lcc = 'gcc' if 'e2k' in out and 'lcc' in out: guess_gcc_or_lcc = 'lcc' -- cgit v1.2.3