Bug 602245 - Don't build SIMPLE_PROGRAMS during MOZ_PROFILE_GENERATE pass. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 14 Apr 2011 11:23:13 +0200
changeset 68103 1203611ef3dcc53c730ad127cdfbe5b93e7e1053
parent 68102 daf83138f3e212f533146eb85f6babb79fb837f6
child 68104 c72ec462f70ce56a7774809bd5131c16cee8e96b
push idunknown
push userunknown
push dateunknown
reviewersted
bugs602245
milestone6.0a1
Bug 602245 - Don't build SIMPLE_PROGRAMS during MOZ_PROFILE_GENERATE pass. r=ted
config/config.mk
config/rules.mk
js/src/config/config.mk
js/src/config/rules.mk
toolkit/mozapps/update/test/Makefile.in
tools/trace-malloc/Makefile.in
uriloader/exthandler/tests/Makefile.in
xpcom/tests/Makefile.in
xpcom/tests/windows/Makefile.in
--- a/config/config.mk
+++ b/config/config.mk
@@ -337,16 +337,21 @@ NO_PROFILE_GUIDED_OPTIMIZE = 1
 endif
 
 # Don't build SIMPLE_PROGRAMS with PGO, since they don't need it anyway,
 # and we don't have the same build logic to re-link them in the second pass.
 ifdef SIMPLE_PROGRAMS
 NO_PROFILE_GUIDED_OPTIMIZE = 1
 endif
 
+# No sense in profiling unit tests
+ifdef CPP_UNIT_TESTS
+NO_PROFILE_GUIDED_OPTIMIZE = 1
+endif
+
 # Enable profile-based feedback
 ifndef NO_PROFILE_GUIDED_OPTIMIZE
 ifdef MOZ_PROFILE_GENERATE
 OS_CFLAGS += $(PROFILE_GEN_CFLAGS)
 OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS)
 OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
 ifeq (WINNT,$(OS_ARCH))
 AR_FLAGS += -LTCG
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -356,16 +356,21 @@ ifeq (86,$(findstring 86,$(OS_TEST)))
 OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
 endif # x86
 endif # Solaris Sun Studio C++
 
 ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
 HOST_PDBFILE=$(basename $(@F)).pdb
 endif
 
+# Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
+ifdef MOZ_PROFILE_GENERATE
+SIMPLE_PROGRAMS :=
+endif
+
 ifndef TARGETS
 TARGETS			= $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY)
 endif
 
 ifndef OBJS
 _OBJS			= \
 	$(JRI_STUB_CFILES) \
 	$(addsuffix .$(OBJ_SUFFIX), $(JMC_GEN)) \
@@ -1696,17 +1701,17 @@ ifneq (,$(SDK_LIBRARY))
 
 ifndef NO_DIST_INSTALL
 libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR)
 	$(INSTALL) $(IFLAGS2) $^
 endif
 
 endif # SDK_LIBRARY
 
-ifneq (,$(SDK_BINARY))
+ifneq (,$(strip $(SDK_BINARY)))
 $(SDK_BIN_DIR)::
 	$(NSINSTALL) -D $@
 
 ifndef NO_DIST_INSTALL
 libs:: $(SDK_BINARY) $(SDK_BIN_DIR)
 	$(INSTALL) $(IFLAGS2) $^
 endif
 
--- a/js/src/config/config.mk
+++ b/js/src/config/config.mk
@@ -337,16 +337,21 @@ NO_PROFILE_GUIDED_OPTIMIZE = 1
 endif
 
 # Don't build SIMPLE_PROGRAMS with PGO, since they don't need it anyway,
 # and we don't have the same build logic to re-link them in the second pass.
 ifdef SIMPLE_PROGRAMS
 NO_PROFILE_GUIDED_OPTIMIZE = 1
 endif
 
+# No sense in profiling unit tests
+ifdef CPP_UNIT_TESTS
+NO_PROFILE_GUIDED_OPTIMIZE = 1
+endif
+
 # Enable profile-based feedback
 ifndef NO_PROFILE_GUIDED_OPTIMIZE
 ifdef MOZ_PROFILE_GENERATE
 OS_CFLAGS += $(PROFILE_GEN_CFLAGS)
 OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS)
 OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
 ifeq (WINNT,$(OS_ARCH))
 AR_FLAGS += -LTCG
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -356,16 +356,21 @@ ifeq (86,$(findstring 86,$(OS_TEST)))
 OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
 endif # x86
 endif # Solaris Sun Studio C++
 
 ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
 HOST_PDBFILE=$(basename $(@F)).pdb
 endif
 
+# Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
+ifdef MOZ_PROFILE_GENERATE
+SIMPLE_PROGRAMS :=
+endif
+
 ifndef TARGETS
 TARGETS			= $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY)
 endif
 
 ifndef OBJS
 _OBJS			= \
 	$(JRI_STUB_CFILES) \
 	$(addsuffix .$(OBJ_SUFFIX), $(JMC_GEN)) \
@@ -1696,17 +1701,17 @@ ifneq (,$(SDK_LIBRARY))
 
 ifndef NO_DIST_INSTALL
 libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR)
 	$(INSTALL) $(IFLAGS2) $^
 endif
 
 endif # SDK_LIBRARY
 
-ifneq (,$(SDK_BINARY))
+ifneq (,$(strip $(SDK_BINARY)))
 $(SDK_BIN_DIR)::
 	$(NSINSTALL) -D $@
 
 ifndef NO_DIST_INSTALL
 libs:: $(SDK_BINARY) $(SDK_BIN_DIR)
 	$(INSTALL) $(IFLAGS2) $^
 endif
 
--- a/toolkit/mozapps/update/test/Makefile.in
+++ b/toolkit/mozapps/update/test/Makefile.in
@@ -108,11 +108,13 @@ check::
 	$(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/
 	@$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX)
 endif # ANDROID
 
 libs:: unit/head_update.js.in
 	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $^ > $(TESTROOT)/unit/head_update.js
 
 ifndef ANDROID
+ifndef MOZ_PROFILE_GENERATE
 libs::
 	$(INSTALL) TestAUSHelper$(BIN_SUFFIX) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
+endif
 endif # ANDROID
--- a/tools/trace-malloc/Makefile.in
+++ b/tools/trace-malloc/Makefile.in
@@ -63,17 +63,19 @@ SIMPLE_PROGRAMS	= \
 		$(NULL)
 
 CSRCS            = \
 		spacetrace.c \
 		spacecategory.c \
 		formdata.c \
 		$(NULL)
 
+ifndef MOZ_PROFILE_GENERATE
 PROGRAM		= spacetrace$(BIN_SUFFIX)
+endif
 
 ifeq ($(OS_ARCH),WINNT)
 LOCAL_INCLUDES	+= -I$(topsrcdir)/config/os2
 endif
 
 include $(topsrcdir)/config/config.mk
 
 ifdef MOZ_ENABLE_LIBXUL
--- a/uriloader/exthandler/tests/Makefile.in
+++ b/uriloader/exthandler/tests/Makefile.in
@@ -70,10 +70,12 @@ LIBS +=		\
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 export PERSONAL_MAILCAP=$(shell cd $(srcdir) && pwd)/mailcap
 endif
 
 # need the executable for running the xpcshell unit tests
+ifneq (,$(SIMPLE_PROGRAMS))
 libs::
 	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
+endif
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -167,17 +167,19 @@ endif
 
 LOCAL_INCLUDES	= \
                 -I$(srcdir)/../ds \
 		-I$(srcdir)/services \
 		$(NULL)
 
 libs::
 	$(INSTALL) $(srcdir)/test.properties $(DIST)/bin/res
+ifneq (,$(SIMPLE_PROGRAMS))
 	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
+endif
 
 # Copy TestHarness.h into its own module, for ease of setting up includes
 # correctly.
 export::
 	$(NSINSTALL) -D $(DIST)/include/testing
 	$(INSTALL) $(srcdir)/TestHarness.h $(DIST)/include/testing
 
 install::
--- a/xpcom/tests/windows/Makefile.in
+++ b/xpcom/tests/windows/Makefile.in
@@ -39,19 +39,16 @@ DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= xpcom
 
-
-include $(topsrcdir)/config/config.mk
-
 CPP_UNIT_TESTS	= \
                   TestCOM.cpp \
                   $(NULL)
 
 # TestNTFSPermissions is causing oranges because it's creating directories
 # multiple times, and then leaving them in a state where they can't be cleaned
 #CPP_UNIT_TESTS += TestNTFSPermissions.cpp