diff mbox

cygwin: fix --tsaware, add --large-address-aware

Message ID 53EAF450.3070600@redhat.com
State New
Headers show

Commit Message

Yaakov Selkowitz Aug. 13, 2014, 5:14 a.m. UTC
This patch fixes two issues with LINK_SPEC on Cygwin targets:

1) --tsaware makes sense only for EXEs, not DLLs.

2) Under WoW64 (32-bit Cygwin on 64-bit Windows), Cygwin applications 
can access up to 4 GiB of address space (for DLLs, Cygwin heap, mmap()s, 
etc.) if they are linked with --large-address-aware.  Because of how 
Cygwin implements fork(), the ability to use this extra space is a huge 
benefit.  This flag too is only for EXEs, not DLLs.

Patch attached.

Comments

Kai Tietz Aug. 13, 2014, 7:48 a.m. UTC | #1
2014-08-13 7:14 GMT+02:00 Yaakov Selkowitz <yselkowi@redhat.com>:
> This patch fixes two issues with LINK_SPEC on Cygwin targets:
>
> 1) --tsaware makes sense only for EXEs, not DLLs.
>
> 2) Under WoW64 (32-bit Cygwin on 64-bit Windows), Cygwin applications can
> access up to 4 GiB of address space (for DLLs, Cygwin heap, mmap()s, etc.)
> if they are linked with --large-address-aware.  Because of how Cygwin
> implements fork(), the ability to use this extra space is a huge benefit.
> This flag too is only for EXEs, not DLLs.
>
> Patch attached.
>
> --
> Yaakov Selkowitz
> Associate Software Engineer, ARM
> Red Hat, Inc.

Hi Yaakov,

patch is ok.  I will apply it for you today.

Thanks,
Kai
Kai Tietz Aug. 19, 2014, 3:04 p.m. UTC | #2
Applied for you at revision 214158.

Kai
diff mbox

Patch

Index: gcc/config/i386/cygwin-w64.h
===================================================================
--- gcc/config/i386/cygwin-w64.h	(revision 213759)
+++ gcc/config/i386/cygwin-w64.h	(working copy)
@@ -66,7 +66,8 @@ 
   %{static:-Bstatic} %{!static:-Bdynamic} \
   %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
   %(shared_libgcc_undefs) \
-  --dll-search-prefix=cyg -tsaware"
+  --dll-search-prefix=cyg \
+  %{!shared: %{!mdll: %{" SPEC_32 ":--large-address-aware} --tsaware}}"
 
 /* Cygwin64 will have a 64-bit long type. */
 #undef LONG_TYPE_SIZE
Index: gcc/config/i386/cygwin.h
===================================================================
--- gcc/config/i386/cygwin.h	(revision 213759)
+++ gcc/config/i386/cygwin.h	(working copy)
@@ -120,7 +120,8 @@ 
   %{shared: --shared} %{mdll:--dll} \
   %{static:-Bstatic} %{!static:-Bdynamic} \
   %{shared|mdll: --enable-auto-image-base -e __cygwin_dll_entry@12} \
-  --dll-search-prefix=cyg -tsaware"
+  --dll-search-prefix=cyg \
+  %{!shared: %{!mdll: --large-address-aware --tsaware}}"
 
 /* Binutils does not handle weak symbols from dlls correctly.  For now,
    do not use them unnecessarily in gthr-posix.h.  */