As part of our work with Tor, we’ve been working on getting a MinGW-based
build of Windows into TaskCluster. Tor is currently using ESR releases, and
every ESR they have to go through a large amount of work to get the build
working under MinGW again; by continually building (and testing) that build
we’ll be able to cut weeks to months of effort for them each ESR release.
(Not breaking the MinGW build is also a necessity if they were ever to move
off ESRs.)

Unlike our normal Windows builds with msvc or clang-cl, this is a
cross-compile on Linux for Windows, as well as the first time in a long
time we’ve built for Windows with gcc. Building with gcc for Windows has
exposed a number of new warnings
<https://bugzilla.mozilla.org/show_bug.cgi?id=1394433> to clean up, as well
as some C++ spec incompatibilities that MSVC (and clang-cl) accept. All of
the breaks have been resolved; and a lot of the warnings and similar are
either resolved or in-progress.

Effective this weekend, MinGW is on Treeherder, with the single build
target win32-mingw32 (debug). Its toolchain builds are under TMW (with a
few under TL because they are generic Linux packages.)

The one-click loaner system works for MinGW, and we’re going to allow this
to bake at Tier 2 for a while. Your help in keeping the build green is
greatly appreciated, and if you hit a MinGW bug you can’t decipher, I’ll be
happy to help, just send me an email or a needinfo. Some of the most common
things that cause errors for MinGW:


 - #include <Windows.h> instead of #include <windows.h> and similar

 - _uuidof() instead of IID_* ref
<https://stackoverflow.com/questions/18606546/how-to-use-uuidof-in-mingw>

 - Casting nullptr to bool or int

 - Using the (in)correct assembly code

 - Breaking --disable-webrtc, --disable-sandbox, or --disable-accessibility

 - MinGW lagging behind on defining new constants Microsoft has defined

There are a few things left outstanding
<https://bugzilla.mozilla.org/showdependencytree.cgi?id=1330608&hide_resolved=1>
for the MinGW build, including webrtc
<https://bugzilla.mozilla.org/show_bug.cgi?id=1393901>, stylo
<https://bugzilla.mozilla.org/show_bug.cgi?id=1390583> (which may be the
most difficult in this list), the sandbox
<https://bugzilla.mozilla.org/show_bug.cgi?id=1230910>,
--enable-accessibility
<https://sourceforge.net/p/mingw-w64/bugs/648/>, cleaning
up warnings <https://bugzilla.mozilla.org/show_bug.cgi?id=1394433>, and running
tests <https://bugzilla.mozilla.org/show_bug.cgi?id=1395047>. In the
future, there is hope (by me at least) to throw all of this work away.
Compiling on Linux for Windows with clang (or clang-cl) would probably be a
significant improvement for Tor’s builds, and would enable them to take
advantage of CFI and SEH, as well as simplifying the number of platforms
Mozilla supports. Chrome has been pushing towards this
<https://bugs.chromium.org/p/chromium/issues/detail?id=495204>, so we’re
keeping an eye on their progress.

Finally, I want to thank everyone who brought this long process to this
point: everyone who wrote patches, explained things (sometimes over and
over again), and reviewed. That’s including but not limited to: boklm,
dmajor, froydnj, glandium, georg, jacek, jrmuizel, and ted; plus the dozen
or so more people who have reviewed my patches all over the codebase.


-tom
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to