At present, clang can't be used as a replacement for x86_64-w64-mingw32-gcc, as it doesn't understand Gentoo's directory layout. There's workarounds for this upstream in clang/lib/Driver/ToolChains/Gnu.cpp, but no equivalent code in MinGW.cpp.
Steps to Reproduce:
1. install crossdev for x86_64-w64-mingw32
2. try to compile simple program with clang -target x86_64-w64-mingw32
clang won't find any header files. If it can be coaxed to do so, it still passes through the wrong paths to the linker.
`clang -target x86_64-w64-mingw32` works equivalently to `x86_64-w64-mingw32-gcc`
Created attachment 706245 [details, diff]
patch to fix issue
Please submit this patch to reviews.llvm.org and get upstream to approve it. Once it's in main, I can backport it to Gentoo.
(please add me to subscribers to your diff, I'm 'mgorny' there)
hi, was this patch ever pushed to upstream?
Submitted but not accepted: https://reviews.llvm.org/D111081
Created attachment 786824 [details, diff]
patch updated for clang 14.0.5
I think upstream asked you to rebase the tests after some other changes were made, so it might be accepted once you rebase?
I was kind of interested into compiling dxvk libs with x86_64-w64-mingw32-clang, do you think the changes suggested could allow for that?