public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Dave Korn <dave.korn.cygwin@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
	 "binutils@sourceware.org" <binutils@sourceware.org>
Subject: [committed] Increase tool executables' stack size to 12MB on windows
Date: Thu, 02 Dec 2010 23:45:00 -0000	[thread overview]
Message-ID: <4CF83530.3000307@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]


    Hi lists,

  The default stack allocation for the main thread of an executable on Windows
is only 2MB, which isn't very much.  This leads to failures in some of the GCC
testsuite limits-* tests.

  Some time ago the cygwin and mingw host config scripts had LDFLAGS adjusted
to turn the stack size up to 8MB in the compilers (and other tools).  However,
it turns out that LDFLAGS only affects the stage 1 and cross build (the
original patch was tested in cross, which is presumably why no problem showed
up); to pass flags through a full bootstrap, you need to set BOOT_LDFLAGS

  So, the attached patch adds the same setting to BOOT_LDFLAGS, and turns both
up from 8MB to 12MB in the process.  (I tried 10MB and that wasn't enough.
This was only actually needed by the compilers, but will affect the other
tools anyway; however I don't suppose the extra memory usage will matter on
these desktop workstation platforms.)

config/ChangeLog:

2010-12-02  Dave Korn  <...

	* mh-cygwin (LDFLAGS): Turn up stack allocation to 12MB.
	(BOOT_LDFLAGS): Add matching stack size flag.
	* mh-mingw (LDFLAGS): Likewise.
	(BOOT_LDFLAGS): Likewise.

  Committed to GCC svn at r.167400 and synced across to CVS src/.

    cheers,
      DaveK

[-- Attachment #2: cygming-stack-size.diff --]
[-- Type: text/x-c, Size: 1256 bytes --]

Index: config/mh-cygwin
===================================================================
--- config/mh-cygwin	(revision 167399)
+++ config/mh-cygwin	(working copy)
@@ -1,8 +1,10 @@
 EXTRA_TARGET_HOST_ALL_MODULES=maybe-all-libtermcap
 EXTRA_TARGET_HOST_INSTALL_MODULES=maybe-install-libtermcap
 
-# Increase stack limit to same as Linux default.
-LDFLAGS += -Wl,--stack,8388608
+# Increase stack limit to a figure based on the Linux default, with 4MB added
+# as GCC turns out to need that much more to pass all the limits-* tests.
+LDFLAGS += -Wl,--stack,12582912
+BOOT_LDFLAGS += -Wl,--stack,12582912
 
 all-gdb: maybe-all-libtermcap
 
Index: config/mh-mingw
===================================================================
--- config/mh-mingw	(revision 167399)
+++ config/mh-mingw	(working copy)
@@ -2,5 +2,7 @@
 # Vista (see PR33281 for details).
 BOOT_CFLAGS += -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format
 CFLAGS += -D__USE_MINGW_ACCESS
-# Increase stack limit to same as Linux default.
-LDFLAGS += -Wl,--stack,8388608
+# Increase stack limit to a figure based on the Linux default, with 4MB added
+# as GCC turns out to need that much more to pass all the limits-* tests.
+LDFLAGS += -Wl,--stack,12582912
+BOOT_LDFLAGS += -Wl,--stack,12582912

                 reply	other threads:[~2010-12-02 23:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF83530.3000307@gmail.com \
    --to=dave.korn.cygwin@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).