From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79421 invoked by alias); 7 Nov 2018 11:59:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 79409 invoked by uid 89); 7 Nov 2018 11:59:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Nov 2018 11:59:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7423357151; Wed, 7 Nov 2018 05:38:43 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OwL0kpCJi8og; Wed, 7 Nov 2018 05:38:43 -0500 (EST) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 9E7125BA13; Wed, 7 Nov 2018 03:34:30 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTP id wA78YEIF778334; Wed, 7 Nov 2018 06:34:16 -0200 From: Alexandre Oliva To: JonY <10walls@gmail.com> Cc: NightStrike , "Joseph S. Myers" , GCC Patches Subject: Re: introduce --enable-mingw-full32 to default to --large-address-aware References: <18c16bb7-c54f-f086-0e90-f06345be10d8@gmail.com> <5ba2e87d-b49e-195d-8fbb-62e992c681c1@gmail.com> <9893706a-37ac-8290-bb7b-1cf2f562ed77@gmail.com> Date: Wed, 07 Nov 2018 11:59:00 -0000 In-Reply-To: <9893706a-37ac-8290-bb7b-1cf2f562ed77@gmail.com> (JonY's message of "Thu, 1 Nov 2018 10:48:17 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-11/txt/msg00435.txt.bz2 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, --=20 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=C3=A1s-GNUChe