This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Increase stack limit on Windows hosts


On Sun, 8 Jun 2008, Paolo Bonzini wrote:

> ... can you add
> 
> flags_to_pass = { flag= LDFLAGS_FOR_BUILD ; };
> 
> to Makefile.def and use it in gcc/configure.ac?  This would fix the case in
> which a generator program used lots of stack.
> 
> Using an ifeq in the Makefile.in is fine but, if you're adding
> LDFLAGS_FOR_BUILD, it's probably easier to add a @BUILD_LDFLAGS@ autoconf
> substitution at the same time, that is set in the same place as
> CFLAGS_FOR_BUILD.

How does this version seem?  OK to commit?

2008-06-08  Joseph Myers  <joseph@codesourcery.com>

	PR tree-optimization/36218
	* Makefile.def (flags_to_pass): Add LDFLAGS_FOR_BUILD.
	* Makefile.tpl (EXTRA_BUILD_FLAGS): Define.
	(all prefix="build-"): Pass them to build-system sub-makes.
	* Makefile.in: Regenerate.

config:
2008-06-08  Joseph Myers  <joseph@codesourcery.com>

	PR tree-optimization/36218
	* config/mh-mingw (LDFLAGS): Define.

gcc:
2008-06-08  Joseph Myers  <joseph@codesourcery.com>

	PR tree-optimization/36218
	* configure.ac: Use LDFLAGS="${LDFLAGS_FOR_BUILD}" when running
	configure for the build system.
	(BUILD_LDFLAGS): Define.
	* configure: Regenerate.
	* Makefile.in (BUILD_LDFLAGS): Define to @BUILD_LDFLAGS@.

Index: Makefile.def
===================================================================
--- Makefile.def	(revision 136546)
+++ Makefile.def	(working copy)
@@ -215,6 +215,7 @@
 flags_to_pass = { flag= INSTALL_DATA ; };
 flags_to_pass = { flag= INSTALL_PROGRAM ; };
 flags_to_pass = { flag= INSTALL_SCRIPT ; };
+flags_to_pass = { flag= LDFLAGS_FOR_BUILD ; };
 flags_to_pass = { flag= LEX ; };
 flags_to_pass = { flag= M4 ; };
 flags_to_pass = { flag= MAKE ; };
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 136546)
+++ Makefile.tpl	(working copy)
@@ -147,6 +147,12 @@
 	WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
 	WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
 
+# These variables must be set on the make command line for directories
+# built for the build system to override those in BASE_FLAGS_TO_PASSS.
+EXTRA_BUILD_FLAGS = \
+	CFLAGS="$(CFLAGS_FOR_BUILD)" \
+	LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
 # This is the list of directories to built for the host system.
 SUBDIRS = @configdirs@
 # This is set by the configure script to the arguments to use when configuring
@@ -955,7 +961,8 @@
 	     target_alias=(get "target" "${target_alias}")
 	     args="$(BUILD_CONFIGARGS)" no-config-site=true +]
 
-[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +]
+[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
+	     args="$(EXTRA_BUILD_FLAGS)" +]
 [+ ENDFOR build_module +]
 
 # --------------------------------------
Index: config/mh-mingw
===================================================================
--- config/mh-mingw	(revision 136546)
+++ config/mh-mingw	(working copy)
@@ -2,3 +2,5 @@
 # Vista (see PR33281 for details).
 BOOT_CFLAGS += -D__USE_MINGW_ACCESS
 CFLAGS += -D__USE_MINGW_ACCESS
+# Increase stack limit to same as Linux default.
+LDFLAGS = -Wl,--stack,8388608
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 136546)
+++ gcc/configure.ac	(working copy)
@@ -1460,6 +1460,7 @@
 	esac
 	saved_CFLAGS="${CFLAGS}"
 	CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+	LDFLAGS="${LDFLAGS_FOR_BUILD}" \
 	${realsrcdir}/configure \
 		--enable-languages=${enable_languages-all} \
 		--target=$target_alias --host=$build_alias --build=$build_alias
@@ -1756,6 +1757,7 @@
 # These are the normal (build=host) settings:
 CC_FOR_BUILD='$(CC)'		AC_SUBST(CC_FOR_BUILD)
 BUILD_CFLAGS='$(ALL_CFLAGS)'	AC_SUBST(BUILD_CFLAGS)
+BUILD_LDFLAGS='$(LDFLAGS)'	AC_SUBST(BUILD_LDFLAGS)
 STMP_FIXINC=stmp-fixinc		AC_SUBST(STMP_FIXINC)
 
 # Possibly disable fixproto, on a per-target basis.
@@ -1773,6 +1775,7 @@
 if test x$build != x$host || test "x$coverage_flags" != x
 then
     BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
+    BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
 
     if test "x$TARGET_SYSTEM_ROOT" = x; then
 	if test "x$STMP_FIXPROTO" != x; then
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 136546)
+++ gcc/Makefile.in	(working copy)
@@ -662,7 +662,7 @@
 BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
 
 # Native linker and preprocessor flags.  For x-fragment overrides.
-BUILD_LDFLAGS=$(LDFLAGS)
+BUILD_LDFLAGS=@BUILD_LDFLAGS@
 BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
 
 # Actual name to use when installing a native compiler.


-- 
Joseph S. Myers
joseph@codesourcery.com


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