[PATCH] Fix -unawareness of large-addresses on mingw (#8520)
kyrab at mail.ru
Sun Jun 8 09:23:36 UTC 2014
There is a problem here.
While setting LARGEADDRESSAWARE apparently works for GHC *itself*, we
can't be sure it works for any GHC-generated executable because it can
potentially be linked with some *foreign* code which is not
LARGEADDRESSAWARE compatible (see
So, perhaps, we should not apply this patch, but only set this flag for
After all it's possible to feed GHC with something like '-optl-Xlinker
-optl--large-address-aware' to set this flag on the particular
executable if necessary.
On 6/8/2014 12:30, Simon Marlow wrote:
> If someone validates this on Windows it could go in. Add it to #8520
> and put the ticket in the patch state?
> On 04/06/2014 10:15, kyra wrote:
>> LARGEADDRESSAWARE flag if set in executable's header tells the OS that
>> the application can handle addresses larger than 2GB.
>> For 32-bit executables it is disabled usually. To enable it we must tell
>> linker to enable it or manually edit an executable - for example,
>> peflags of editbin (from Microsoft) utilities could be used.
>> On 6/4/2014 11:23, Simon Marlow wrote:
>>> I don't know what this does, and there doesn't seem to be any info in
>>> #8520 either.
>>> Could you add the patch to the ticket, and help us out by saying why
>>> this fixes the problem (and if possible, explain why it won't break
>>> anything else)?
>>> On 03/06/2014 07:06, transfuturist wrote:
>>>> compiler/main/SysTools.lhs | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>> diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
>>>> index dc9642d..1cf1155 100644
>>>> --- a/compiler/main/SysTools.lhs
>>>> +++ b/compiler/main/SysTools.lhs
>>>> @@ -740,6 +740,7 @@ getLinkerInfo' dflags = do
>>>> [ -- Reduce ld memory usage
>>>> , "-Wl,--reduce-memory-overheads"
>>>> + , "-Wl,--large-address-aware" --Trac #8520
>>>> -- Increase default stack, see
>>>> -- Note [Windows stack usage]
>>>> , "-Xlinker", "--stack=0x800000,0x800000" ]
>>> ghc-devs mailing list
>>> ghc-devs at haskell.org
>> ghc-devs mailing list
>> ghc-devs at haskell.org
> ghc-devs mailing list
> ghc-devs at haskell.org
More information about the ghc-devs