Bug 975733 - Move some LDFLAGS for building executables on Windows to moz.build; r=mshal
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 26 Feb 2014 21:38:29 -0500
changeset 170879 0c188671f47556085d2f91f59871331934dbe848
parent 170878 f8054c8163298a17c57b3407dd1a0928f707c623
child 170880 dcb142b44f68d8ae5636adfb9a981b13fb05b96d
push id26304
push usercbook@mozilla.com
push dateThu, 27 Feb 2014 13:46:41 +0000
treeherderautoland@0b930fe64a1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs975733
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 975733 - Move some LDFLAGS for building executables on Windows to moz.build; r=mshal
browser/app/Makefile.in
browser/app/moz.build
embedding/tests/winEmbed/Makefile.in
embedding/tests/winEmbed/moz.build
ipc/app/Makefile.in
ipc/app/moz.build
webapprt/win/Makefile.in
webapprt/win/moz.build
xulrunner/app/Makefile.in
xulrunner/app/moz.build
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -62,32 +62,16 @@ RCINCLUDE = splash.rc
 # here.
 EXTRA_DEPS += firefox.exe.manifest
 endif
 
 PROGRAMS_DEST = $(DIST)/bin
 
 include $(topsrcdir)/config/rules.mk
 
-ifeq ($(OS_ARCH),WINNT) #{
-#
-# Control the default heap size.
-# This is the heap returned by GetProcessHeap().
-# As we use the CRT heap, the default size is too large and wastes VM.
-#
-# The default heap size is 1MB on Win32.
-# The heap will grow if need be.
-#
-# Set it to 256k.  See bug 127069.
-#
-ifndef GNU_CC #{
-LDFLAGS += /HEAP:0x40000
-endif #}
-endif #}
-
 ifneq (,$(filter-out WINNT,$(OS_ARCH)))
 
 ifdef COMPILE_ENVIRONMENT
 libs:: 
 	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
 GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -35,8 +35,19 @@ LOCAL_INCLUDES += [
 
 if CONFIG['_MSC_VER']:
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DEFINES['MOZ_PHOENIX'] = True
+
+# Control the default heap size.
+# This is the heap returned by GetProcessHeap().
+# As we use the CRT heap, the default size is too large and wastes VM.
+#
+# The default heap size is 1MB on Win32.
+# The heap will grow if need be.
+#
+# Set it to 256k.  See bug 127069.
+if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
+    LDFLAGS += ['/HEAP:0x40000']
--- a/embedding/tests/winEmbed/Makefile.in
+++ b/embedding/tests/winEmbed/Makefile.in
@@ -32,27 +32,8 @@ LIBS = \
 	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
 	$(NULL)
 
 STL_FLAGS=
 
 OS_LIBS		+= $(call EXPAND_LIBNAME,ole32 comdlg32 shell32 version)
 
 include $(topsrcdir)/config/rules.mk
-
-#
-# Control the default heap size.
-# This is the heap returned by GetProcessHeap().
-# As we use the CRT heap, the default size is too large and wastes VM.
-#
-# The default heap size is 1MB on Win32.
-# The heap will grow if need be.
-#
-# Set it to 256k.  See bug 127069.
-#
-ifndef GNU_CC
-LDFLAGS += /HEAP:0x40000
-endif
-
-# Get rid of console window
-ifdef GNU_CC
-LDFLAGS += -mwindows
-endif
--- a/embedding/tests/winEmbed/moz.build
+++ b/embedding/tests/winEmbed/moz.build
@@ -12,8 +12,22 @@ SOURCES += [
     'winEmbed.cpp',
 ]
 
 XPI_NAME = 'winembed'
 
 DEFINES['XPCOM_GLUE'] = True
 
 RESFILE = 'winEmbed.res'
+
+if CONFIG['GNU_CC']:
+    # Get rid of console window
+    LDFLAGS += ['-mwindows']
+else:
+    # Control the default heap size.
+    # This is the heap returned by GetProcessHeap().
+    # As we use the CRT heap, the default size is too large and wastes VM.
+    #
+    # The default heap size is 1MB on Win32.
+    # The heap will grow if need be.
+    #
+    # Set it to 256k.  See bug 127069.
+    LDFLAGS += ['/HEAP:0x40000']
--- a/ipc/app/Makefile.in
+++ b/ipc/app/Makefile.in
@@ -45,29 +45,16 @@ ifeq ($(OS_ARCH),WINNT) #{
 ifdef MOZ_CONTENT_SANDBOX
 LIBS += ../../security/sandbox/$(LIB_PREFIX)sandbox_s.$(LIB_SUFFIX)
 LIBS += $(NSPR_LIBS)
 endif
 
 # Note the manifest file exists in the tree, so we use the explicit filename
 # here.
 EXTRA_DEPS += plugin-container.exe.manifest
-#
-# Control the default heap size.
-# This is the heap returned by GetProcessHeap().
-# As we use the CRT heap, the default size is too large and wastes VM.
-#
-# The default heap size is 1MB on Win32.
-# The heap will grow if need be.
-#
-# Set it to 256k.  See bug 127069.
-#
-ifndef GNU_CC #{
-LDFLAGS += /HEAP:0x40000
-endif #}
 endif #}
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{
 
 libs::
 	$(NSINSTALL) -D $(DIST)/bin/$(PROGRAM).app
 	rsync -a -C --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/bin/$(PROGRAM).app 
 	sed -e 's/%PROGRAM%/$(PROGRAM)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/bin/$(PROGRAM).app/Contents/Info.plist
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -29,8 +29,19 @@ if CONFIG['MOZ_CONTENT_SANDBOX'] and CON
         '/security/sandbox',
         '/security/sandbox/chromium',
     ]
 
 if CONFIG['_MSC_VER']:
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
+
+# Control the default heap size.
+# This is the heap returned by GetProcessHeap().
+# As we use the CRT heap, the default size is too large and wastes VM.
+#
+# The default heap size is 1MB on Win32.
+# The heap will grow if need be.
+#
+# Set it to 256k.  See bug 127069.
+if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
+    LDFLAGS += ['/HEAP:0x40000']
--- a/webapprt/win/Makefile.in
+++ b/webapprt/win/Makefile.in
@@ -64,21 +64,8 @@ PROGRAMS_DEST = $(DIST)/bin
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk
 
 GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid)
 DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
 
 webapprt.$(OBJ_SUFFIX): $(DEPTH)/config/buildid
-
-# Control the default heap size.
-# This is the heap returned by GetProcessHeap().
-# As we use the CRT heap, the default size is too large and wastes VM.
-#
-# The default heap size is 1MB on Win32.
-# The heap will grow if need be.
-#
-# Set it to 256k.  See bug 127069.
-#
-ifndef GNU_CC
-LDFLAGS += /HEAP:0x40000
-endif
--- a/webapprt/win/moz.build
+++ b/webapprt/win/moz.build
@@ -23,8 +23,19 @@ LOCAL_INCLUDES += [
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 if CONFIG['_MSC_VER']:
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
+
+# Control the default heap size.
+# This is the heap returned by GetProcessHeap().
+# As we use the CRT heap, the default size is too large and wastes VM.
+#
+# The default heap size is 1MB on Win32.
+# The heap will grow if need be.
+#
+# Set it to 256k.  See bug 127069.
+if not CONFIG['GNU_CC']:
+    LDFLAGS += ['/HEAP:0x40000']
--- a/xulrunner/app/Makefile.in
+++ b/xulrunner/app/Makefile.in
@@ -36,32 +36,16 @@ ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
 RCINCLUDE = splash.rc
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DXULRUNNER_ICO='"$(DIST)/branding/xulrunner.ico"' -DDOCUMENT_ICO='"$(DIST)/branding/document.ico"'
 
-ifeq ($(OS_ARCH),WINNT)
-#
-# Control the default heap size.
-# This is the heap returned by GetProcessHeap().
-# As we use the CRT heap, the default size is too large and wastes VM.
-#
-# The default heap size is 1MB on Win32.
-# The heap will grow if need be.
-#
-# Set it to 256k.  See bug 127069.
-#
-ifndef GNU_CC
-LDFLAGS += /HEAP:0x40000
-endif
-endif
-
 ifdef MOZ_WIDGET_GTK
 libs::
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(DIST)/bin/chrome/icons/default
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(DIST)/bin/chrome/icons/default
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(DIST)/bin/chrome/icons/default
 endif
 
 # XXX applications would need to supply this file
--- a/xulrunner/app/moz.build
+++ b/xulrunner/app/moz.build
@@ -26,8 +26,19 @@ LOCAL_INCLUDES += [
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 if CONFIG['_MSC_VER']:
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
+
+# Control the default heap size.
+# This is the heap returned by GetProcessHeap().
+# As we use the CRT heap, the default size is too large and wastes VM.
+#
+# The default heap size is 1MB on Win32.
+# The heap will grow if need be.
+#
+# Set it to 256k.  See bug 127069.
+if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
+    LDFLAGS += ['/HEAP:0x40000']