I have MSYS2 installed on my Windows computer. The installation package includes files such as mingw64.exe, clang64.exe, and others. According to this page, when running the corresponding executable file, we expect to use the appropriate environment.
However, in my case there is the following oddity:
Run
mingw64.exe-> $echo $PATHout is/clang64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perlRun
clang64.exe-> $echo $PATHout is/clang64/bin:/clang64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perlRun
clangarm64.exe-> $echo $PATHout is/clang64/bin:/clangarm64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Thus, one way or another the clang compiler will be used, which is completely not expected
UPDATE
According to the recommendations of ChatGPT, I tested the $MSYSTEM variable:
- Run
mingw64.exe->echo $MSYSTEM-> MINGW64 - Run
clang64.exe->echo $MSYSTEM-> CLANG64
The result is correct
It is not normal to have
/clang64/binon your PATH when you runmingw64.exe. There must be a startup script somewhere that is adding it.Run the following command to look for any mentions of
clang64in the startup scripts:If that doesn't illuminate anything, you might have to look more carefully at those scripts to see what they are doing. You can also try putting
echo $PATHcommands at various points in those scripts to debug them.