delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/14/14:57:19

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,TW_NW
X-Spam-Check-By: sourceware.org
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX1+bbUmuvpqCdMM9KKiJftHW
Date: Sat, 14 Apr 2012 14:56:51 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: gcc: turning off large-address awareness
Message-ID: <20120414185651.GB17287@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4F896504 DOT 3030006 AT cornell DOT edu> <CA+sc5mnBXZ_+R9OKUX2idT_TBxE82U4ZfbOkcuWZgn9Y6TGxeA AT mail DOT gmail DOT com> <4F89B215 DOT 9050903 AT cornell DOT edu> <20120414173342 DOT GD15801 AT ednor DOT casa DOT cgf DOT cx> <CA+sc5mmg_pKy5HrR1csaGFPjV82ute3VRM9H04=ffhydKqfQWw AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CA+sc5mmg_pKy5HrR1csaGFPjV82ute3VRM9H04=ffhydKqfQWw@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Sat, Apr 14, 2012 at 01:52:46PM -0400, Earnie Boyd wrote:
>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 AT 12}
>>>%{!mno-cygwin:__cygwin_dll_entry AT 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.

That's not what -shared means.

  -shared
       Produce a shared object which can then be linked with other
       objects to form an executable.

  -mdll
       This option is available for Cygwin and MinGW targets.  It
       specifies that a DLL - a dynamic link library - is to be
       generated, enabling the selection of the required runtime startup
       object and entry point.

These should be the default whenever you build an executable.  You can
verify yourself by specifying the -v option to gcc when linking
something.

cgf

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019