introduce --enable-mingw-full32 to default to --large-address-aware

Alexandre Oliva oliva@adacore.com
Wed Nov 7 11:59:00 GMT 2018


On Nov  1, 2018, JonY <10walls@gmail.com> wrote:

> Looks like it causes an error on 64bit:
> /usr/libexec/gcc/x86_64-w64-mingw32/ld: unrecognized option
> '--large-address-aware'

What does?  The patch I suggested?  The current trunk?

What was the command in this case?  How was the toolchain configured?


I've been looking into this, getting progressively puzzled, though I
actually managed to duplicated the problem you mentioned, but only on
x86_64-mingw32, NOT on x86_64-w64-mingw32.


Here's what I found out in my investigation:

configured for i686-mingw32, GNU ld supports only the i386pe emulation,
that supports the --large-address-aware flag.

Configured for x86_64-*-mingw32, it supports i386pe, but it defaults to
i386pep, the 64-bit binary format, that does NOT support
--large-address-aware.

x86_64-w64-mingw32 passes -mi386pe or -mi386pep to the linker, depending
on -m32 or -m64, so the code to pass --large-address-aware to link -m32
binaries in mingw-w64.h looks correct to me.  But x86_64-mingw32 does
NOT use that: it uses the LINK_SPEC from mingw32.h, so it doesn't
specify the emulation, ever.  That seems awfully broken to me.  If you
ask for a 32-bit binary, using the default 64-bit linker format is
unlikely to produce the desired results.

Is x86_64-mingw32 really supposed to be a usable target name?  It might
even work as a 64-bit only target, but I don't see how its biarch
support could possibly be functional.

If it is to be usable, is it really supposed to be different from
x86_64-w64-mingw32?  Using mingw-w64.h besides mingw32.h would fix the
biarch problems, but perhaps that's not desired for other reasons.

Fixing that is way beyond my knowledge or interest on Windows-based
platforms, but given clarification as to whether x86_64-mingw32 is
supposed to support biarch at all, I might be able to fix the
implementation of --enable-large-address-aware there.

As for the problem you reported on x86_64-w64-mingw32, I'm afraid I'll
need some more information to be able to duplicate that and try to fix
it.

Thanks,

-- 
Alexandre Oliva, freedom fighter   https://FSFLA.org/blogs/lxo
Be the change, be Free!         FSF Latin America board member
GNU Toolchain Engineer                Free Software Evangelist
Hay que enGNUrecerse, pero sin perder la terGNUra jamás-GNUChe



More information about the Gcc-patches mailing list