This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: introduce --enable-mingw-full32 to default to --large-address-aware
- From: Alexandre Oliva <oliva at adacore dot com>
- To: JonY <10walls at gmail dot com>
- Cc: NightStrike <nightstrike at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 07 Nov 2018 06:34:14 -0200
- Subject: Re: introduce --enable-mingw-full32 to default to --large-address-aware
- References: <orzhvtnnk2.fsf@lxoliva.fsfla.org> <alpine.DEB.2.21.1810051609440.6703@digraph.polyomino.org.uk> <or1s8zww9k.fsf@lxoliva.fsfla.org> <18c16bb7-c54f-f086-0e90-f06345be10d8@gmail.com> <or1s8y32ni.fsf@lxoliva.fsfla.org> <fd28c121-d14f-4b58-111e-caa5106c0869@gmail.com> <orin2a1jpf.fsf@lxoliva.fsfla.org> <5ba2e87d-b49e-195d-8fbb-62e992c681c1@gmail.com> <CAF1jjLsvEL6VEhriq=hokeSYAg3Kf+oCXSGWcSgmWt2MWXBQxQ@mail.gmail.com> <eafcffd2-ad51-6319-a60b-45947d954890@gmail.com> <orzhvjwvw3.fsf@lxoliva.fsfla.org> <ork1lxspuw.fsf@lxoliva.fsfla.org> <9893706a-37ac-8290-bb7b-1cf2f562ed77@gmail.com>
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