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. Reproducible: Always Steps to Reproduce: 1. install crossdev for x86_64-w64-mingw32 2. try to compile simple program with clang -target x86_64-w64-mingw32 Actual Results: 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. Expected Results: `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?
patch was accepted upstream, once you push it its available in =clang-15.0.0.9999 :-)
patch landed in dev branch, thank you for your efforts bug may be closed, unless the llvm wants to cherry pick it for 14.x?
(In reply to tt_1 from comment #9) > patch landed in dev branch, thank you for your efforts > > bug may be closed, unless the llvm wants to cherry pick it for 14.x? Requested at https://github.com/llvm/llvm-project/issues/56701.
ah yeah, asking upstream to backport is first priority - thank you I was under the impression, that there will be no new patch release of 14.x branch but we'll see what happens I guess.
So upstream declined a backport, can the llvm team please consider to pick it into the patchset? It's needed to compile app-emulation/dxvk with mingw32-clang
(In reply to tt_1 from comment #12) > So upstream declined a backport, can the llvm team please consider to pick > it into the patchset? It's needed to compile app-emulation/dxvk with > mingw32-clang Sorry, could you clarify whether this affects only specific environments or will it affect general Gentoo builds for dxvk? I'm trying to establish whether we need to revbump clang for it or if we can sneak it in silently.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26971cfa9e665e7e3e03cbce9f9a346874d96a8c commit 26971cfa9e665e7e3e03cbce9f9a346874d96a8c Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2022-07-29 07:17:54 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2022-07-29 10:09:36 +0000 sys-devel/clang: Backport MinGW patch to 14.0.6-r1 Closes: https://bugs.gentoo.org/788430 Signed-off-by: Michał Górny <mgorny@gentoo.org> sys-devel/clang/Manifest | 1 + sys-devel/clang/clang-14.0.6-r1.ebuild | 440 +++++++++++++++++++++++++++++++++ 2 files changed, 441 insertions(+)