llvm-mingw support update

Jacek Caban jacek at codeweavers.com
Fri Dec 20 08:36:51 CST 2019

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.




[2] https://github.com/mstorsjo/llvm-mingw

[3] https://source.winehq.org/patches/data/176054

More information about the wine-devel mailing list