-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CLANG64/x86_64-w64-mingw32-clang link error if C:\msys64\mingw64\bin is in PATH #19279
Comments
probably not a good idea to have two different compilers on path in any case. |
Yes I agree. The issuse is actually from Windows runners of github actions. @mstorsjo do you have any idea about the issue? |
I would guess that this is the same issue as #11495. See https://github.com/llvm/llvm-project/blob/234678fbf9cf05c232221bb8253ed658507f3b49/clang/lib/Driver/ToolChains/MinGW.cpp#L413-L427 (as linked in the issue above) for the logic; when Clang is invoked in mingw mode, it tries to locate the right sysroot. In the case of llvm-mingw, there's a CC @mati865; to pick up the discussion from #11495 which I feel was kinda derailed... When looking at the Clang logic in https://github.com/llvm/llvm-project/blob/234678fbf9cf05c232221bb8253ed658507f3b49/clang/lib/Driver/ToolChains/MinGW.cpp#L413-L427, what if we'd before line 422 would check if e.g. |
That seems very likely. |
Yeah, it basically a duplicate. |
@mstorsjo Thanks for the details. I've successfully implemented the following workaround on Windows runner.
|
…a proper mingw sysroot This fixes uses of the MSYS2 clang64 environment compilers, if another set of GCC based compilers are available further back in PATH (which may be explicitly added, or inherited unintentionally from other software installed). (The issue in the clang64 environment can be worked around somewhat by installing *-gcc-compat packages which present aliases named <triple>-gcc within the clang64 environment as well.) This fixes msys2/MINGW-packages#11495 and msys2/MINGW-packages#19279.
…a proper mingw sysroot (#76949) This fixes uses of the MSYS2 clang64 environment compilers, if another set of GCC based compilers are available further back in PATH (which may be explicitly added, or inherited unintentionally from other software installed). (The issue in the clang64 environment can be worked around somewhat by installing *-gcc-compat packages which present aliases named <triple>-gcc within the clang64 environment as well.) This fixes msys2/MINGW-packages#11495 and msys2/MINGW-packages#19279.
FWIW, the fix for this landed in upstream Clang in mstorsjo/llvm-project@c671870. |
…a proper mingw sysroot (llvm#76949) This fixes uses of the MSYS2 clang64 environment compilers, if another set of GCC based compilers are available further back in PATH (which may be explicitly added, or inherited unintentionally from other software installed). (The issue in the clang64 environment can be worked around somewhat by installing *-gcc-compat packages which present aliases named <triple>-gcc within the clang64 environment as well.) This fixes msys2/MINGW-packages#11495 and msys2/MINGW-packages#19279.
MSYS2 has upgraded to Clang 18.1.2. Thanks the fix by @mstorsjo . |
Description / Steps to reproduce the issue
Expected behavior
Use the the pre-built binaries from https://github.com/mstorsjo/llvm-mingw, it can run without error:
Actual behavior
Verification
Windows Version
MINGW64_NT-10.0-19045
MINGW environments affected
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: