Hi all,
Last night Martin pushed an update to llvm-mingw bumping version of LLVM to a commit that includes a number of fixes for Wine. See [1] for details. Thank you, Martin! Meantime, Wine got required fixes, so that it all should mostly work together. If you want to try it, just clone [2] git and run:
DEFAULT_MSVCRT=msvcrt-os ./build-all.sh /path/to/install
If the installation is on PATH, current Wine should be able to use it without any additional tweaks. You should be able to configure it just like configuration on GCC-based mingw works.
DEFAULT_MSVCRT=msvcrt-os part is needed because Wine can't deal with mingw-w64 defaulting to crt version other than msvcrt.dll. This is not a problem specific to LLVM, we will hit the same problem on GCC if mingw-w64 is configured to use other crt (usually ucrt, things like msvcrt100 is also possible). It is not yet a popular setup, but it will probably be more popular over time, so it would be great to have it supported. The ultimate solution for Wine is to always use -nodefaultlibs for all its binaries. It's already the case for all Wine builtin DLLs, we just need to do the same for EXEs. I have some unfinished patches for that, but it's not something appropriate for code freeze. I'm experimenting with a smaller fix, because it would be great to have something sooner, but using DEFAULT_MSVCRT=msvcrt-os is required for now.
One of nice LLVM features is support for PDB files. If you want to make a build with PDB files, configure Wine like this:
configure CROSSCFLAGS="-g -gcodeview -O2" CROSSLDFLAGS="-Wl,-pdb=" #append your usual args
and then run make like: make CROSSLDFLAGS="-Wl,-pdb="
The additional make argument is needed because Wine does not yet propagate CROSSLDFLAGS from configure. Patch [3] should fix it.
Cheers,
Jacek
[1] https://github.com/mstorsjo/llvm-mingw/commit/056c1f5cd22b1c5ca76af38f2d1f9a...
On 20.12.2019 15:36, Jacek Caban wrote:
DEFAULT_MSVCRT=msvcrt-os part is needed because Wine can't deal with mingw-w64 defaulting to crt version other than msvcrt.dll.
With current Wine git, this is no longer relevant, Wine should handle that fine. mingw-w64 config just needs to be good enough for configure tests, so any sane mingw-w64 configuration will work. If you want to use llvm-mingw, leaving its default config is probably a good choice in general.
Cheers,
Jacek
On Tue, 28 Jan 2020, Jacek Caban wrote:
On 20.12.2019 15:36, Jacek Caban wrote:
DEFAULT_MSVCRT=msvcrt-os part is needed because Wine can't deal with mingw-w64 defaulting to crt version other than msvcrt.dll.
With current Wine git, this is no longer relevant, Wine should handle that fine. mingw-w64 config just needs to be good enough for configure tests, so any sane mingw-w64 configuration will work. If you want to use llvm-mingw, leaving its default config is probably a good choice in general.
Awesome! Thanks for working on this!
// Martin
On 20.12.2019 15:36, Jacek Caban wrote:
One of nice LLVM features is support for PDB files. If you want to make a build with PDB files, configure Wine like this:
configure CROSSCFLAGS="-g -gcodeview -O2" CROSSLDFLAGS="-Wl,-pdb=" #append your usual args
and then run make like: make CROSSLDFLAGS="-Wl,-pdb="
We have proper build system support for that now, the new way to build PDB files is:
configure CROSSDEBUG=pdb
Cheers,
Jacek