Hi Joe, On Thu, 26 Dec 2019 22:20:45 -0500, Joe Nahmias <j...@nahmias.net> wrote: > I recently became interested in cross-compiling software from Debian to > Windows. To my delight, I found the gcc-mingw-w64 & mingw-w64-tools > packages already in Debian (thanks Stephen!). However, I see that they > are using a workaround of a /usr/${triplet}/ path, rather than multi-arch. > > Then found and read through this bug which hasn't seen an update in 5+ > years :( Meanwhile, the Windows world has changed quite a bit in that > time, with Windows 10 being released in 2015, and Windows 7 due to go > EOL on 2020-01-14. > > So, how can I best help the effort to get a proper multi-arch > infrastructure in Debian appropriate from cross-building using mingw-w64?
We still need to figure out how to handle the triplet. There are multiple goals, from end users’ perspectives, some conflicting: * provide a Windows cross-compiler with a good selection of libraries, within Debian, so that it’s easy to build Windows programs and their installers; * provide a Windows cross-compiler which integrates well with externally-provided libraries; * provide a Windows cross-compiler fulfilling the requirements of other Debian packages (this is what got me started down this path: Wine Gecko, Wine Mono, Debian installer components, etc.). The main sticking point in this bug is the choice of target triplet. The current situation is as follows: * MinGW-w64 upstream have settled on <cpu>-w64-mingw32, distinct from MinGW’s <cpu>-pc-mingw32; * GCC supports both, and uses the -w64- part to distinguish between “plain” MinGW support and MinGW-w64 support; * the Windows cross-compiling community at large uses <cpu>-w64-mingw32. (Note that the GCC docs claim that -pc-mingw32 is used for MinGW-w64, but that’s incorrect.) Guillem has explained in previous emails why -w64-mingw32 causes issues in Debian. There are other problems with the triplet which haven’t been mentioned so far: mainly, that the same triplet is used for different compiler configurations which effectively result in different ABIs. For 32-bit targets, there’s DW2 v. SJLJ (64-bit only used SEH); for all targets, there’s POSIX v. Win32 threads; a more recent development is support for UCRT instead of MSVCRT. I see two main questions to answer: * for Debian multiarch, what triplet(s) make most sense? * ignoring multiarch, how can we provide a useful cross-compiler which supports all the target setups users are likely to need? -m options via spec files? I’ve been working on the latter mostly. I’m fairly busy just now so I won’t necessarily be all that responsive, but I’m interested in your thoughts on the subject. Regards, Stephen
pgp3bm9I0rGoe.pgp
Description: OpenPGP digital signature