This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

> On 11/07/2018 08:34 AM, Alexandre Oliva wrote:
>> On Nov  1, 2018, JonY 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?

> No it's just a quick test to see how x86_64-w64-mingw32 reacts to
> --large-address-aware, it doesn't play well.

I understand, but you're getting a different result from what I am, I'd
like to understand why before attempting to "fix" something that AFAICT
is correct and behaving just as intended.  Maybe there are valid reasons
to drop --large-address-aware altogether on x86_64-w64-mingw32, but I'd
like to understand why, as in, how the error above came about for you,
when it didn't for me.

I built gcc and binutils in a single tree, with x86_64-w64-mingw32 as
the target, and the resulting linker would accept --large-address-aware
in the -mi386-pe emulation, and that emulation was explicitly enabled
when building -m32 binaries.  Does your w64 toolchain deviate from any
of these facts?


> x86_64-mingw32 is not used as far as I know, only with "w64" or "pc".

x86_64-mingw32's canonical form is x86_64-pc-mingw32, and they're
equivalent, so whatever you say or know about the latter should apply to
the shorter form as well.  Likewise, my questions and doubts about the
shorter form apply equally to the canonical one.

> The "w64" carries a special meaning to gcc dating back to the early
> 64bit port. It basically tells gcc to use mingw-w64 specific features
> that are not found on the regular mingw.org CRT at the time.

I see.  So -pc- and -w64- are not supposed to be equivalent indeed.
Thanks.

> This might be affecting the "pc" vendor build, can you check
> x86_64-pc-mingw32 just to see if it is affected?

I did.  Its -m32 mode seems broken to me.  As I wrote, the linker
emulation is never specified, so it would build 64-bit binaries even
when given -m32.  Because it lacks explicit linker emulation
specification, it can't have --large-address-aware specified either.

In my link tests, i686-mingw32 and x86_64-w64-mingw32 both worked (in
that their respective linkers wouldn't reject the --large-address-aware
passed by gcc) with the --large-address-aware patch that is installed in
trunk.  Ditto with the incremental patch I posted last week, that would
have only improved x86_64-pc-mingw32.

-- 
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]