This is the mail archive of the cygwin mailing list for the Cygwin 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: gcc: turning off large-address awareness


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


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