Jean-Michaël Celerier via llvm-dev
2018-Nov-06 12:45 UTC
[llvm-dev] Trying to cross-compile LLVM runtimes to Windows
I have been using this project with great success to achieve this : https://github.com/mstorsjo/llvm-mingw It generates a linux-based windows cross-compiler with clang, libc++, etc. I was able to build a large part of Qt with it afterwards for instance. Best, Jean-Michaël On 06/11/2018 04:21, Petr Hosek via llvm-dev wrote:> I've tried building libc++ for Windows on Linux by setting clang-cl as > the compiler and lld-link as the linker, but I immediately hit > roadblocks. The first issue seems to be the fact that CMake appears to > ignore the value of CMAKE_RC_COMPILER variable and hardcodes "rc" as > the resource compiler. This got resolved in upstream 12 days ago > (https://github.com/Kitware/CMake/commit/bd9bfc644954a48b1bf7ea18fc260a1231840671) > > I managed to workaround this issue by symlinking llvm-rc as rc. > However, that's not sufficient because CMake uses following invocation > (https://github.com/Kitware/CMake/blob/master/Source/cmcmd.cxx#L1815): > > rc /foCMakeFiles/cmTC_2c376.dir/manifest.res > CMakeFiles/cmTC_2c376.dir/manifest.rc > > llvm-rc option parses requires /fo option argument to be separate. > I've modified the flag to support both joined and separate value which > helped getting past that error, but I immediately hit another error: > https://reviews.llvm.org/P8113 > > The problem seems to be that the .rc file generated by CMake contains > an absolute path to the resource, but llvm-rc expects the path to be > always relative. However, I couldn't fine any documentation that would > explain whether that's a requirement and it's CMake's fault or whether > llvm-rc should be handling absolute paths as well. Is anyone familiar > with Windows resource file semantics? > > All of these errors seem to suggest that this cross-compiling for > Windows with Clang using CMake isn't a well explored area. Has anyone > had more success with cross-compiling LLVM runtimes (libc++, > compiler-rt) to Windows? > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Martin Storsjö via llvm-dev
2018-Nov-06 13:46 UTC
[llvm-dev] Trying to cross-compile LLVM runtimes to Windows
On Tue, 6 Nov 2018, Jean-Michaël Celerier via llvm-dev wrote:> I have been using this project with great success to achieve this : > https://github.com/mstorsjo/llvm-mingw > > It generates a linux-based windows cross-compiler with clang, libc++, etc.FWIW, lately I've added prebuilt packages of it that you can run on actual windows as well, even though cross compilation was my first/main focus.> I was able to build a large part of Qt with it afterwards for instance.Any particular part of Qt which you weren't able to build with it? I regularly build Qt (qtbase) for i686/x86_64/armv7/aarch64, and as part of VLC, I also build a few more Qt modules (qtdeclarative, qtquickcontrols2) for i686 and x86_64. // Martin
Zachary Turner via llvm-dev
2018-Nov-06 14:00 UTC
[llvm-dev] Trying to cross-compile LLVM runtimes to Windows
I suspect mingw is going to be incompatible with Petr’s needs. Adding Nico as he probably does the most cross compiling. I did it a little several weeks ago, just not with libc++, and I don’t remember running into any problems. One thing that’s not clear to me is why the resource compiler is even being invoked at all On Tue, Nov 6, 2018 at 5:46 AM Martin Storsjö via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On Tue, 6 Nov 2018, Jean-Michaël Celerier via llvm-dev wrote: > > > I have been using this project with great success to achieve this : > > https://github.com/mstorsjo/llvm-mingw > > > > It generates a linux-based windows cross-compiler with clang, libc++, > etc. > > FWIW, lately I've added prebuilt packages of it that you can run on actual > windows as well, even though cross compilation was my first/main focus. > > > I was able to build a large part of Qt with it afterwards for instance. > > Any particular part of Qt which you weren't able to build with it? I > regularly build Qt (qtbase) for i686/x86_64/armv7/aarch64, and as part of > VLC, I also build a few more Qt modules (qtdeclarative, qtquickcontrols2) > for i686 and x86_64. > > // Martin > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181106/67874130/attachment.html>
Jean-Michaël Celerier via llvm-dev
2018-Nov-06 14:09 UTC
[llvm-dev] Trying to cross-compile LLVM runtimes to Windows
No, it's just that I didn't try to build qtwebkit / qtwebengine / qt3d since I don't use them. Everything else seemed to build fine (including the qml stuff as you mentioned). On 06/11/2018 14:46, Martin Storsjö wrote:> > Any particular part of Qt which you weren't able to build with it?