[m-rev.] for review: more fixes for building on Windows

Julien Fischer jfischer at opturion.com
Thu Jan 23 16:08:55 AEDT 2020


On Thu, 23 Jan 2020, Peter Wang wrote:

> On Thu, 23 Jan 2020 14:51:47 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
>>
>> More fixes for building on Windows.
>>
>> The configuration types returned by autoconf for MinGW have a long and
>> complicated history. For the current version of config.sub we use they will
>> match one of:
>>
>>      *-pc-msys      (i.e. executables linked against the MSYS DLLs)
>>      *-pc-mingw32   (i.e. 32-bit native executables)
>>      *-pc-mingw64   (i.e. 64-bit native executables)
>>
>> We do not support the first possibility, but do support the other two.
>>
>> Older versions of config.sub reported MinGW64 as *-w64-mingw{32,64} and pieces
>> of the existing configure script still assume that. This diff changes the
>> configure script to match what is currently returned by config.sub.
>
> Did something change? I thought the "w64" bit signified the
> MinGW-w64 port, which is a separate project from MinGW?

Yes, it's a separate project; there's a few things in play here.

1. The original MinGW project; this provides 32-bit GCC and the
MSYS environment.

2. MinGW-w64; this provides both 64- and 32-bit ports of GCC.
(The 32-bit port is not the same as the one in (1).)

3. MSYS2, which packages up (2).

What I am trying to do here is get installation under MSYS2 working
more smoothly; at the moment it's very easy for configuration options
to be left out.

When using MinGW-64 under the original MSYS (or when cross-compiling on
Linux etc) we need to pass --host=x86_64-w64-mingw32 etc so that the
compiler and other build tools invoked as x86_64-w64-mingw32-gcc etc.

Under MSYS2 it's different; there depending on how you invoke it
you will get different compiler toolchains (the three I listed above),
all of them simply named gcc etc (i.e. without the x86_64-w64- prefix.)

> I install mingw-w64 package on Ubuntu (probably the same on Debian)
> which provides the binaries /usr/bin/x86_64-w64-mingw32-gcc etc.
> Then I run configure mercury with
>
>    ./tools/configure_mingw_cross --host=x86_64-w64-mingw32

I think we should be able to support all of this; I'll post a revised
diff in a bit.

Julien.


More information about the reviews mailing list