introduce --enable-large-address-aware
authorAlexandre Oliva <oliva@adacore.com>
Fri, 12 Oct 2018 20:11:27 +0000 (20:11 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 12 Oct 2018 20:11:27 +0000 (20:11 +0000)
Add a configure knob for mingw32 and 64 toolchains to default passing
--large-address-aware to the linker, when creating 32-bit binaries.
-Wl,--disable-large-address-aware can still reverse its effects.

for  gcc/ChangeLog

* configure.ac: Introduce --enable-large-address-aware
to define MINGW_DEFAULT_LARGE_ADDR_AWARE.
* doc/install.texi: Document it.
* configure, config.in: Rebuilt.
* config/i386/mingw32.h (LINK_SPEC_LARGE_ADDR_AWARE): Define,
based on MINGW_DEFAULT_LARGE_ADDR_AWARE.
(LINK_SPEC): Insert it.
* config/i386/mingw-264.h: Likewise.

From-SVN: r265130

gcc/ChangeLog
gcc/config.in
gcc/config/i386/mingw-w64.h
gcc/config/i386/mingw32.h
gcc/configure
gcc/configure.ac
gcc/doc/install.texi

index bc6efa74e236c1fb6a97aa2885e226809085cd01..1cc85d8f23e53a6b1c2076d7893bd3440f3c881b 100644 (file)
@@ -1,5 +1,14 @@
 2018-10-12  Alexandre Oliva <oliva@adacore.com>
 
+       * configure.ac: Introduce --enable-large-address-aware
+       to define MINGW_DEFAULT_LARGE_ADDR_AWARE.
+       * doc/install.texi: Document it.
+       * configure, config.in: Rebuilt.
+       * config/i386/mingw32.h (LINK_SPEC_LARGE_ADDR_AWARE): Define,
+       based on MINGW_DEFAULT_LARGE_ADDR_AWARE.
+       (LINK_SPEC): Insert it.
+       * config/i386/mingw-264.h: Likewise.
+
        * cygming.h (HAVE_GAS_ALIGNED_COMM): Fallback-define.
 
 2018-10-12  Peter Bergner  <bergner@linux.ibm.com>
index d7c3fbfd9b212b88ba5b5947481b89b32809fd93..b807d49712e56481919794ef002c517be4420b22 100644 (file)
 #endif
 
 
+/* Define if we should link with --large-address-aware by default */
+#ifndef USED_FOR_TARGET
+#undef MINGW_DEFAULT_LARGE_ADDR_AWARE
+#endif
+
+
+/* Define if we should link with --large-address-aware by default */
+#ifndef USED_FOR_TARGET
+#undef MINGW_DEFAULT_LARGE_ADDR_AWARE
+#endif
+
+
 /* Value to set mingw's _dowildcard to. */
 #ifndef USED_FOR_TARGET
 #undef MINGW_DOWILDCARD
index 484dc7a9e9f27c1a3c48c1a0853c4207a0227591..00b3f042a36cae7e31318b548e6f25edf291abe2 100644 (file)
@@ -81,6 +81,14 @@ along with GCC; see the file COPYING3.  If not see
 #define MULTILIB_DEFAULTS { "m32" }
 #endif
 
+#undef LINK_SPEC_LARGE_ADDR_AWARE
+#if MINGW_DEFAULT_LARGE_ADDR_AWARE
+# define LINK_SPEC_LARGE_ADDR_AWARE \
+  "%{!shared:%{!mdll:%{" SPEC_32 ":--large-address-aware}}}"
+#else
+# define LINK_SPEC_LARGE_ADDR_AWARE ""
+#endif
+
 #undef LINK_SPEC
 #define LINK_SPEC SUB_LINK_SPEC " %{mwindows:--subsystem windows} \
   %{mconsole:--subsystem console} \
@@ -88,4 +96,5 @@ along with GCC; see the file COPYING3.  If not see
   %{shared: --shared} %{mdll:--dll} \
   %{static:-Bstatic} %{!static:-Bdynamic} \
   %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
+  " LINK_SPEC_LARGE_ADDR_AWARE "\
   %(shared_libgcc_undefs)"
index a66010894208b85b379a738ee58e1ade3e734184..c9d8a7a31f30e7bfd235e912d98ba9decf473092 100644 (file)
@@ -114,12 +114,20 @@ along with GCC; see the file COPYING3.  If not see
 #define SUBTARGET_EXTRA_SPECS                                          \
   { "shared_libgcc_undefs", SHARED_LIBGCC_UNDEFS_SPEC }
 
+#if MINGW_DEFAULT_LARGE_ADDR_AWARE
+# define LINK_SPEC_LARGE_ADDR_AWARE \
+  "%{!shared:%{!mdll:--large-address-aware}}"
+#else
+# define LINK_SPEC_LARGE_ADDR_AWARE ""
+#endif
+
 #define LINK_SPEC "%{mwindows:--subsystem windows} \
   %{mconsole:--subsystem console} \
   %{shared: %{mdll: %eshared and mdll are not compatible}} \
   %{shared: --shared} %{mdll:--dll} \
   %{static:-Bstatic} %{!static:-Bdynamic} \
   %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \
+  " LINK_SPEC_LARGE_ADDR_AWARE "\
   %(shared_libgcc_undefs)"
 
 /* Include in the mingw32 libraries with libgcc */
index 3e33a69628bd8239c29713849f217b3b1c69240c..563860181a1c1ae7e469e89a1716e0dd8fceb124 100755 (executable)
@@ -928,6 +928,7 @@ enable_sjlj_exceptions
 with_gcc_major_version_only
 enable_secureplt
 enable_mingw_wildcard
+enable_large_address_aware
 enable_leading_mingw64_underscores
 enable_cld
 enable_frame_pointer
@@ -1645,6 +1646,8 @@ Optional Features:
   --enable-secureplt      enable -msecure-plt by default for PowerPC
   --enable-mingw-wildcard Set whether to expand wildcard on command-line.
                           Default to platform configuration
+  --enable-large-address-aware
+                          Link mingw executables with --large-address-aware
   --enable-leading-mingw64-underscores
                           enable leading underscores on 64 bit mingw targets
   --enable-cld            enable -mcld by default for 32bit x86
@@ -12037,6 +12040,17 @@ _ACEOF
 
 fi
 
+# Check whether --enable-large-address-aware was given.
+if test "${enable_large_address_aware+set}" = set; then :
+  enableval=$enable_large_address_aware;
+fi
+
+if test x"$enable_large_address_aware" = xyes; then :
+
+$as_echo "#define MINGW_DEFAULT_LARGE_ADDR_AWARE 1" >>confdefs.h
+
+fi
+
 # Check whether --enable-leading-mingw64-underscores was given.
 if test "${enable_leading_mingw64_underscores+set}" = set; then :
   enableval=$enable_leading_mingw64_underscores;
@@ -18495,7 +18509,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18498 "configure"
+#line 18512 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18601,7 +18615,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18604 "configure"
+#line 18618 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index ff6444a0f9b4615642f8669bbec6fc66e6bf8421..c5c33af374ccb1fa84c0d8be6522c65dc06c029d 100644 (file)
@@ -1852,6 +1852,13 @@ AS_IF([test x"$enable_mingw_wildcard" != xplatform ],
                 $(test x"$enable_mingw_wildcard" = xno; echo $?),
                 [Value to set mingw's _dowildcard to.])])
 
+AC_ARG_ENABLE(large-address-aware,
+[AS_HELP_STRING([--enable-large-address-aware],
+               [Link mingw executables with --large-address-aware])])
+AS_IF([test x"$enable_large_address_aware" = xyes],
+  [AC_DEFINE([MINGW_DEFAULT_LARGE_ADDR_AWARE], 1,
+    [Define if we should link mingw executables with --large-address-aware])])
+
 AC_ARG_ENABLE(leading-mingw64-underscores,
   AS_HELP_STRING([--enable-leading-mingw64-underscores],
                  [enable leading underscores on 64 bit mingw targets]),
index 93022517b315e4607ab08b4e78c1608b8aaaa26a..6dd21bb915ee855aded1eb52a92ac1d33d27e9ca 100644 (file)
@@ -1734,6 +1734,14 @@ Using the GNU Compiler Collection (GCC)},
 See ``i386 and x86-64 Options'' in the main manual
 @end ifhtml
 
+@item --enable-large-address-aware
+The @option{--enable-large-address-aware} option arranges for MinGW
+executables to be linked using the @option{--large-address-aware}
+option, that enables the use of more than 2GB of memory.  If GCC is
+configured with this option, its effects can be reversed by passing the
+@option{-Wl,--disable-large-address-aware} option to the so-configured
+compiler driver.
+
 @item --enable-win32-registry
 @itemx --enable-win32-registry=@var{key}
 @itemx --disable-win32-registry