Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xspeed1989 opened this issue Dec 20, 2024 · 6 comments
Labels
more info needed More info is needed from the community for us to properly triage and investigate.

Comments

@xspeed1989
Copy link

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

{
  "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

[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

@Yingzi1234
Copy link
Collaborator

@xspeed1989 Thank you for your github issue! Since you are already working on Linux, you don't need MSYS2 as it is designed for Windows environments. If your goal is to use Clang on Linux, the process is much simpler. Could you answer what Linux system you are using if you need us to provide you with a way to install clang?

@Yingzi1234 Yingzi1234 added more info needed More info is needed from the community for us to properly triage and investigate. and removed triage labels Dec 24, 2024
@xspeed1989
Copy link
Author

xspeed1989 commented Dec 25, 2024 via email

@Yingzi1234
Copy link
Collaborator

@xspeed1989 Thank you for your reply! You can follow the steps below to install:

  1. Run below command to Enable the EPEL Repository
    sudo dnf install clang
  2. Run below command to install Clang
    sudo dnf install clang
  3. Run below command to check the clang version
    clang --version
  4. Run below command to install additional clang package
sudo dnf install clang-tools-extra
sudo dnf install llvm-devel
  1. Run below command to install LLVM-Mingw
git clone https://github.com/mstorsjo/llvm-mingw.git
cd llvm-mingw
mkdir build
cd build
cmake ..
make
sudo make install

@Yingzi1234
Copy link
Collaborator

Hi @gcampbell-msft , this issue is not a issue about CMake Tools, could you help move this issue under the correct path? Thank you in advance!

@xspeed1989
Copy link
Author

xspeed1989 commented Dec 26, 2024 via email

@Yingzi1234
Copy link
Collaborator

@xspeed1989 Yes, when we reproduced it we realized that the provided repo doesn't contain a CMakeLists.txt file, which may cause the configuration to fail already as well as the build, you can either add one yourself, or do a quick build by running the command CMake: Quick start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Status: Blocked
Development

No branches or pull requests

2 participants