GCC not recognized anymore
See original GitHub issue- OS: GNU/Linux (5.11.16-arch1-1 #1 SMP PREEMPT Wed, 21 Apr 2021 17:22:13 +0000 x86_64 GNU/Linux)
- VS Code: 1.55.2
- CMakeTools: 1.7.0
- Installed compilers: gcc 10.2.0, clang 11.1.0
Since yesterday, when I scanned available Kits, GCC dropped out of the list. Setting cmake.loggingLevel to debug permitted me to see GCC is not recognized (sorry output is in french):
[kit] Bad GCC binary "/usr/bin/gcc -v" version:10.2.0 output: Utilisation des specs internes.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Cible : x86_64-pc-linux-gnu
Configuré avec: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Modèle de thread: posix
Algorithmes de compression LTO supportés: zlib zstd
gcc version 10.2.0 (GCC)
After reading issue #1575, I checked the extension code and actual gcc output and found the failure here: https://github.com/microsoft/vscode-cmake-tools/blob/d5fa7327a0ecde7dfb86c96263d089c04cfb24b0/src/kit.ts#L156
gcc help (man gcc) explains -v
is not used to get the version (although it is in the output) but information:
-v Print (on standard error output) the commands executed to run the stages of
compilation. Also print the version number of the compiler driver program
and of the preprocessor and the compiler proper.
The real flag to ask for version is --version
:
--version
Display the version number and copyrights of the invoked GCC.
An actually using this flag returns what the extension is expecting:
$ gcc --version
gcc (GCC) 10.2.0
Copyright © 2020 Free Software Foundation, Inc.
Ce logiciel est un logiciel libre; voir les sources pour les conditions de copie. Il n'y a
AUCUNE GARANTIE, pas même pour la COMMERCIALISATION ni L'ADÉQUATION À UNE TÂCHE PARTICULIÈRE.
I suggest that maybe you add the flag to put in the command to the getCompilerVersion()
function, or systematically use --version
(which works for most programs).
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (10 by maintainers)
@riri, if you would like, you can try this vsix (https://github.com/microsoft/vscode-cmake-tools/actions/runs/811030625) to get unblocked with a fix for this issue before we release 1.7.2.
If you are blocked by that other bug, you should be able to manually edit your kits JSON file with the “Edit user-local Kits” command. Just fix the compiler in there and don’t scan for kits again. 😉