microsoft / microsoft/vscode-cmake-tools

Scan kits Unable to recognize x86_64-w64-mingw32-clang++ x86_64-w64-mingw32-clang i686-w64-mingw32-clang i686-w64-mingw32-clang++

Open
#4,213 7 comments 0 reactions 0 assignees View on GitHub
more info needed
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

Unable to recognize x86_64-w64-mingw32-clang++ x86_64-w64-mingw32-clang i686-w64-mingw32-clang i686-w64-mingw32-clang++

### CMake Tools Diagnostics

```shell
{
"os": "linux",
"vscodeVersion": "1.95.3",
"cmtVersion": "1.19.52",
"configurations": [
{
"folder": "/root/test_llvm",
"cmakeVersion": "3.26.5",
"configured": true,
"generator": "Unix Makefiles",
"usesPresets": false,
"compilers": {
"C": "/usr/local/bin/clang",
"CXX": "/usr/local/bin/clang++"
}
}
],
"cpptoolsIntegration": {
"isReady": true,
"hasCodeModel": true,
"activeBuildType": "Debug",
"buildTypesSeen": [
"Debug"
],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 1,
"executablesCount": 1,
"librariesCount": 0,
"targets": [
{
"name": "test_llvm",
"type": "EXECUTABLE"
}
]
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": true
}
]
}
```

### Debug Log

```shell
[build] Build finished with exit code 2
[proc] Executing command: /usr/local/bin/aarch64-w64-mingw32-gcc -v
[proc] Executing command: /usr/local/bin/aarch64-w64-mingw32uwp-gcc -v
[proc] Executing command: /usr/local/bin/armv7-w64-mingw32-gcc -v
[proc] Executing command: /usr/local/bin/armv7-w64-mingw32uwp-gcc -v
[proc] Executing command: /usr/local/bin/clang -v
[proc] Executing command: /usr/local/bin/clang-19 -v
[proc] Executing command: /usr/local/bin/i686-w64-mingw32-gcc -v
[proc] Executing command: /usr/local/bin/i686-w64-mingw32uwp-gcc -v
[proc] Executing command: /usr/local/bin/x86_64-w64-mingw32-gcc -v
[proc] Executing command: /usr/local/bin/x86_64-w64-mingw32uwp-gcc -v
[proc] Executing command: /usr/bin/gcc -v
[proc] Executing command: /usr/bin/x86_64-redhat-linux-gcc -v
[proc] Executing command: /usr/bin/x86_64-redhat-linux-gcc-11 -v
[proc] The command: /usr/local/bin/aarch64-w64-mingw32uwp-gcc -v exited with code: 1
[proc] The command: /usr/local/bin/armv7-w64-mingw32uwp-gcc -v exited with code: 1
[proc] The command: /usr/local/bin/i686-w64-mingw32uwp-gcc -v exited with code: 1
[proc] The command: /usr/local/bin/x86_64-w64-mingw32uwp-gcc -v exited with code: 1
[proc] Executing command: /usr/local/bin/clang -v
[proc] Executing command: /usr/bin/x86_64-redhat-linux-gcc -v
[kit] Found Kit (trusted): Clang 19.1.6 x86_64-unknown-linux-gnu
[kit] Found Kit (trusted): Clang 19.1.6 x86_64-unknown-linux-gnu
[kit] Found Kit (trusted): GCC 11.5.0 x86_64-redhat-linux
[kit] Found Kit (trusted): GCC 11.5.0 x86_64-redhat-linux
[kit] Found Kit (trusted): GCC 11.5.0 x86_64-redhat-linux
[kit] Successfully loaded 2 kits from /root/.local/share/CMakeTools/cmake-tools-kits.json
[extension] [3118] cmake.scanForKits started
[kitsController] Rescanning for kits
[kit] Scanning for Kits on system
[kit] Scanning directory /root/.vscode-server/cli/servers/Stable-f1a4fb101478ce6ec82fe9627c43efbf9e98c813/server/bin/remote-cli for compilers
[kit] Scanning directory /usr/local/sbin for compilers
[kit] Scanning directory /usr/local/bin for compilers
[kit] Scanning directory /usr/sbin for compilers
[kit] Scanning directory /usr/bin for compilers
[kit] Skipping scan of not existing path /root/bin
[kit] Found 0 kits in directory /root/bin
[kit] Skipping scan of not existing path undefined\LLVM\bin
[kit] Found 0 kits in directory undefined\LLVM\bin
[kit] Skipping scan of not existing path undefined\msys64\mingw32\bin
[kit] Found 0 kits in directory undefined\msys64\mingw32\bin
[kit] Skipping scan of not existing path undefined\msys64\mingw64\bin
[kit] Found 0 kits in directory undefined\msys64\mingw64\bin
[kit] Skipping scan of not existing path undefined\msys64\clang32\bin
[kit] Found 0 kits in directory undefined\msys64\clang32\bin
[kit] Skipping scan of not existing path undefined\msys64\clang64\bin
[kit] Found 0 kits in directory undefined\msys64\clang64\bin
[kit] Skipping scan of not existing path undefined\msys64\clangarm64\bin
[kit] Found 0 kits in directory undefined\msys64\clangarm64\bin
[kit] Skipping scan of not existing path undefined\msys64\ucrt64\bin
[kit] Found 0 kits in directory undefined\msys64\ucrt64\bin
[kit] Found 0 kits in directory /root/.vscode-server/cli/servers/Stable-f1a4fb101478ce6ec82fe9627c43efbf9e98c813/server/bin/remote-cli
[kit] Found 0 kits in directory /usr/local/sbin
[kit] Testing GCC binary: /usr/local/bin/aarch64-w64-mingw32-gcc
[proc] Executing command: /usr/local/bin/aarch64-w64-mingw32-gcc -v
[kit] Testing GCC binary: /usr/local/bin/aarch64-w64-mingw32uwp-gcc
[proc] Executing command: /usr/local/bin/aarch64-w64-mingw32uwp-gcc -v
[kit] Testing GCC binary: /usr/local/bin/armv7-w64-mingw32-gcc
[proc] Executing command: /usr/local/bin/armv7-w64-mingw32-gcc -v
[kit] Testing GCC binary: /usr/local/bin/armv7-w64-mingw32uwp-gcc
[proc] Executing command: /usr/local/bin/armv7-w64-mingw32uwp-gcc -v
[kit] Testing Clang binary: /usr/local/bin/clang
[proc] Executing command: /usr/local/bin/clang -v
[kit] Testing Clang binary: /usr/local/bin/clang-19
[proc] Executing command: /usr/local/bin/clang-19 -v
[kit] Testing GCC binary: /usr/local/bin/i686-w64-mingw32-gcc
[proc] Executing command: /usr/local/bin/i686-w64-mingw32-gcc -v
[kit] Testing GCC binary: /usr/local/bin/i686-w64-mingw32uwp-gcc
[proc] Executing command: /usr/local/bin/i686-w64-mingw32uwp-gcc -v
[kit] Testing GCC binary: /usr/local/bin/x86_64-w64-mingw32-gcc
[proc] Executing command: /usr/local/bin/x86_64-w64-mingw32-gcc -v
[kit] Testing GCC binary: /usr/local/bin/x86_64-w64-mingw32uwp-gcc
[proc] Executing command: /usr/local/bin/x86_64-w64-mingw32uwp-gcc -v
[kit] Found 0 kits in directory /usr/sbin
[kit] Testing GCC binary: /usr/bin/gcc
[proc] Executing command: /usr/bin/gcc -v
[kit] Testing GCC binary: /usr/bin/x86_64-redhat-linux-gcc
[proc] Executing command: /usr/bin/x86_64-redhat-linux-gcc -v
[kit] Testing GCC binary: /usr/bin/x86_64-redhat-linux-gcc-11
[proc] Executing command: /usr/bin/x86_64-redhat-linux-gcc-11 -v
[proc] The command: /usr/local/bin/aarch64-w64-mingw32uwp-gcc -v exited with code: 1
[proc] The command: /usr/local/bin/armv7-w64-mingw32uwp-gcc -v exited with code: 1
[proc] The command: /usr/local/bin/i686-w64-mingw32uwp-gcc -v exited with code: 1
[proc] The command: /usr/local/bin/x86_64-w64-mingw32uwp-gcc -v exited with code: 1
[kit] Detected GCC compiler: /usr/bin/x86_64-redhat-linux-gcc-11
[kit] Detected GCC compiler: /usr/bin/x86_64-redhat-linux-gcc
[kit] Detected GCC compiler: /usr/bin/gcc
[kit] Bad GCC binary. "/usr/local/bin/x86_64-w64-mingw32uwp-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/x86_64-w64-windows-gnu.cfg
"/usr/local/bin/ld.lld" -m i386pep -Bdynamic -o a.exe /usr/local/x86_64-w64-mingw32/lib/crt2.o /usr/local/x86_64-w64-mingw32/lib/crtbegin.o -L/usr/local/x86_64-w64-mingw32/lib -L/usr/local/x86_64-w64-mingw32/mingw/lib -L/usr/local/lib/clang/19/lib/windows -lwindowsapp -lucrtapp -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-x86_64.a -lunwind -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-x86_64.a -lunwind -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/local/x86_64-w64-mingw32/lib/crtend.o
ld.lld: error: undefined symbol: WinMain
>>> referenced by ../crt/crtexewin.c:67
>>> libmingw32.a(lib64_libmingw32_a-crtexewin.o):(main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

[kit] Bad GCC binary. "/usr/local/bin/x86_64-w64-mingw32-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/x86_64-w64-windows-gnu.cfg

[kit] Bad GCC binary. "/usr/local/bin/i686-w64-mingw32uwp-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/i686-w64-windows-gnu.cfg
"/usr/local/bin/ld.lld" -m i386pe -Bdynamic -o a.exe /usr/local/i686-w64-mingw32/lib/crt2.o /usr/local/i686-w64-mingw32/lib/crtbegin.o -L/usr/local/i686-w64-mingw32/lib -L/usr/local/i686-w64-mingw32/mingw/lib -L/usr/local/lib/clang/19/lib/windows -lwindowsapp -lucrtapp -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-i386.a -lunwind -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-i386.a -lunwind -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/local/i686-w64-mingw32/lib/crtend.o
ld.lld: error: undefined symbol: _WinMain@16
>>> referenced by ../crt/crtexewin.c:67
>>> libmingw32.a(lib32_libmingw32_a-crtexewin.o):(_main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

[kit] Bad GCC binary. "/usr/local/bin/i686-w64-mingw32-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/i686-w64-windows-gnu.cfg

[kit] Detected Clang compiler: /usr/local/bin/clang-19
[kit] Detected Clang compiler: /usr/local/bin/clang-19
[kit] Detected Clang compiler: /usr/local/bin/clang
[kit] Detected Clang compiler: /usr/local/bin/clang
[kit] Bad GCC binary. "/usr/local/bin/armv7-w64-mingw32uwp-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: armv7-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/armv7-w64-windows-gnu.cfg
"/usr/local/bin/ld.lld" -m thumb2pe -Bdynamic -o a.exe /usr/local/armv7-w64-mingw32/lib/crt2.o /usr/local/armv7-w64-mingw32/lib/crtbegin.o -L/usr/local/armv7-w64-mingw32/lib -L/usr/local/armv7-w64-mingw32/mingw/lib -L/usr/local/lib/clang/19/lib/windows -lwindowsapp -lucrtapp -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-arm.a -lunwind -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-arm.a -lunwind -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/local/armv7-w64-mingw32/lib/crtend.o
ld.lld: error: undefined symbol: WinMain
>>> referenced by ../crt/crtexewin.c:67
>>> libmingw32.a(libarm32_libmingw32_a-crtexewin.o):(main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

[kit] Bad GCC binary. "/usr/local/bin/armv7-w64-mingw32-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: armv7-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/armv7-w64-windows-gnu.cfg

[kit] Bad GCC binary. "/usr/local/bin/aarch64-w64-mingw32uwp-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: aarch64-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/aarch64-w64-windows-gnu.cfg
"/usr/local/bin/ld.lld" -m arm64pe -Bdynamic -o a.exe /usr/local/aarch64-w64-mingw32/lib/crt2.o /usr/local/aarch64-w64-mingw32/lib/crtbegin.o -L/usr/local/aarch64-w64-mingw32/lib -L/usr/local/aarch64-w64-mingw32/mingw/lib -L/usr/local/lib/clang/19/lib/windows -lwindowsapp -lucrtapp -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-aarch64.a -lunwind -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 /usr/local/lib/clang/19/lib/windows/libclang_rt.builtins-aarch64.a -lunwind -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/local/aarch64-w64-mingw32/lib/crtend.o
ld.lld: error: undefined symbol: WinMain
>>> referenced by ../crt/crtexewin.c:67
>>> libmingw32.a(libarm64_libmingw32_a-crtexewin.o):(main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

[kit] Bad GCC binary. "/usr/local/bin/aarch64-w64-mingw32-gcc -v" reports version: output: clang version 19.1.6 (https://github.com/llvm/llvm-project.git e21dc4bd5474d04b8e62d7331362edcc5648d7e5)
Target: aarch64-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Configuration file: /usr/local/bin/aarch64-w64-windows-gnu.cfg

[kit] Testing GCC binary: /usr/bin/x86_64-redhat-linux-gcc
[proc] Executing command: /usr/bin/x86_64-redhat-linux-gcc -v
[kit] Testing Clang binary: /usr/local/bin/clang
[proc] Executing command: /usr/local/bin/clang -v
[kit] Detected GCC compiler: /usr/bin/x86_64-redhat-linux-gcc
[kit] Found 3 kits in directory /usr/bin
[kit] Detected Clang compiler: /usr/local/bin/clang
[kit] Found 2 kits in directory /usr/local/bin
[kit] Found Kit (trusted): Clang 19.1.6 x86_64-unknown-linux-gnu
[kit] Found Kit (trusted): Clang 19.1.6 x86_64-unknown-linux-gnu
[kit] Found Kit (trusted): GCC 11.5.0 x86_64-redhat-linux
[kit] Found Kit (trusted): GCC 11.5.0 x86_64-redhat-linux
[kit] Found Kit (trusted): GCC 11.5.0 x86_64-redhat-linux
[kitsController] Saving kits to /root/.local/share/CMakeTools/cmake-tools-kits.json
[kitsController] Saving new kits to /root/.local/share/CMakeTools/cmake-tools-kits.json
[extension] [3118] cmake.scanForKits finished (returned undefined)
[kit] Reading kits file /root/.local/share/CMakeTools/cmake-tools-kits.json
[kit] Successfully loaded 2 kits from /root/.local/share/CMakeTools/cmake-tools-kits.json
```

### Additional Information

x86_64-w64-mingw32-clang++ x86_64-w64-mingw32-clang i686-w64-mingw32-clang i686-w64-mingw32-clang++
download address:
https://github.com/mstorsjo/llvm-mingw

Contributor guide

Open the contributing guide

Research direction

Start with the kit-scanning and compiler-detection flow described in the debug log, reproducing the scan with the listed x86_64-w64-mingw32 and i686-w64-mingw32 Clang binaries. Trace why these binaries are classified as bad GCC binaries, then verify that the scan recognizes the four Clang executables as kits without breaking existing GCC detection.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.