X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-4.9 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_NW
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20120414173342.GD15801@ednor.casa.cgf.cx>
References: <4F896504.3030006@cornell.edu>	<CA+sc5mnBXZ_+R9OKUX2idT_TBxE82U4ZfbOkcuWZgn9Y6TGxeA@mail.gmail.com>	<4F89B215.9050903@cornell.edu>	<20120414173342.GD15801@ednor.casa.cgf.cx>
Date: Sat, 14 Apr 2012 13:52:46 -0400
Message-ID: <CA+sc5mmg_pKy5HrR1csaGFPjV82ute3VRM9H04=ffhydKqfQWw@mail.gmail.com>
Subject: Re: gcc: turning off large-address awareness
From: Earnie Boyd <earnie@users.sourceforge.net>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q3EHr8fY019896

On Sat, Apr 14, 2012 at 1:33 PM, Christopher Faylor wrote:
> On Sat, Apr 14, 2012 at 01:21:25PM -0400, Ken Brown wrote:
>>On 4/14/2012 12:37 PM, Earnie Boyd wrote:
>>> On Sat, Apr 14, 2012 at 7:52 AM, Ken Brown wrote:
>>>> For testing purposes, I'd like to build without large-address awareness.
>>>>   What's the right way to do that?  I tried
>>>>
>>>>    LDFLAGS=-Wl,--no-large-address-aware
>>>>
>>>> and
>>>>
>>>>    LDFLAGS=-Wl,--disable-large-address-aware
>>>>
>>>> but both resulted in "unrecognized option" errors from ld.
>>>
>>> You specify --large-address-aware if you want it and don't specify if
>>> you don't want it.
>>
>>Sorry, I should have explained more clearly what the issue is.  Cygwin's
>>gcc specifies --large-address-aware by default:
>>
>>$ gcc -dumpspecs | grep large
>>   %{mwindows:--subsystem windows}   %{mconsole:--subsystem console}
>>%{!mno-cygwin:%{!mno-use-libstdc-wrappers:   --wrap _Znwj   --wrap _Znaj
>>   --wrap _ZdlPv   --wrap _ZdaPv   --wrap _ZnwjRKSt9nothrow_t   --wrap
>>_ZnajRKSt9nothrow_t   --wrap _ZdlPvRKSt9nothrow_t   --wrap
>>_ZdaPvRKSt9nothrow_t }}   %{shared: %{mdll: %eshared and mdll are not
>>compatible}}   %{shared: --shared} %{mdll:--dll}   %{static:-Bstatic}
>>%{!static:-Bdynamic}   %{shared|mdll: --enable-auto-image-base -e
>>%{mno-cygwin:_DllMainCRTStartup@12}
>>%{!mno-cygwin:__cygwin_dll_entry@12}}
>>%{!mno-cygwin:--dll-search-prefix=cyg     %{!shared: %{!mdll:
>>--large-address-aware --tsaware}}}
>>
>>I'm trying to override this default.
>
> You're right that there isn't a way to disable --large-address-aware
> but, since it's part of the specs, I'm not sure what would take
> precedence if there was a --disable* option.
>
> You could try using the above to create your own spec file and use
> that on the command line for gcc, cumbersome as it is.

Reading the specs snippet --large-address-aware is only used if
-shared and -mdll have *not* been specified, i.e. you are building
with -static specified.  I think this is a bit strange but I don't
know the reasoning behind it.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


