Bug 1531680 - Don't disable LTO on standalone profile-generate builds. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 05 Mar 2019 22:09:46 +0000
changeset 520375 1bb2ca14033de2be56fa5dee85fed2e0fc961b0b
parent 520374 3824c30869e1975948ec28ac0121b36ed731bb65
child 520376 87dab0b128cba85fa5ec0d9047b53838b3584ce1
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1531680
milestone67.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 1531680 - Don't disable LTO on standalone profile-generate builds. r=chmanchester On one-go MOZ_PGO builds, it's generally not wanted to do LTO during the profile-generate phase. And the build system doesn't really support different build options between both phases in this case, so we relied on MOZ_PROFILE_GENERATE to disable the LTO flags. However, in standalone profile-generate builds, if --enable-lto is passed explicitly, the build should respect that choice. So instead of checking MOZ_PROFILE_GENERATE to disable the LTO flags, we disable them when MOZ_LTO is not set, and we force it to be disabled during the profile-generate phase of one-go MOZ_PGO builds. Differential Revision: https://phabricator.services.mozilla.com/D21659
Makefile.in
config/config.mk
--- a/Makefile.in
+++ b/Makefile.in
@@ -179,17 +179,17 @@ endif
 
 default all::
 	$(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
 
 # PGO build target.
 profiledbuild::
 	$(call BUILDSTATUS,TIERS pgo_profile_generate pgo_package pgo_profile pgo_clobber pgo_profile_use)
 	$(call BUILDSTATUS,TIER_START pgo_profile_generate)
-	$(MAKE) default MOZ_PROFILE_GENERATE=1
+	$(MAKE) default MOZ_PROFILE_GENERATE=1 MOZ_LTO=
 	$(call BUILDSTATUS,TIER_FINISH pgo_profile_generate)
 	$(call BUILDSTATUS,TIER_START pgo_package)
 	$(MAKE) package MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
 	rm -f jarlog/en-US.log
 	$(call BUILDSTATUS,TIER_FINISH pgo_package)
 	$(call BUILDSTATUS,TIER_START pgo_profile)
 	JARLOG_FILE=jarlog/en-US.log $(PYTHON) $(topsrcdir)/build/pgo/profileserver.py
 	$(call BUILDSTATUS,TIER_FINISH pgo_profile)
--- a/config/config.mk
+++ b/config/config.mk
@@ -170,17 +170,17 @@ INCLUDES = \
   -I$(srcdir) \
   -I$(CURDIR) \
   $(LOCAL_INCLUDES) \
   -I$(ABS_DIST)/include \
   $(NULL)
 
 include $(MOZILLA_DIR)/config/static-checking-config.mk
 
-ifdef MOZ_PROFILE_GENERATE
+ifndef MOZ_LTO
 MOZ_LTO_CFLAGS :=
 MOZ_LTO_LDFLAGS :=
 endif
 
 LDFLAGS		= $(MOZ_LTO_LDFLAGS) $(COMPUTED_LDFLAGS) $(PGO_LDFLAGS) $(MK_LDFLAGS)
 
 COMPILE_CFLAGS	= $(MOZ_LTO_CFLAGS) $(COMPUTED_CFLAGS) $(PGO_CFLAGS) $(_DEPEND_CFLAGS) $(MK_COMPILE_DEFINES)
 COMPILE_CXXFLAGS = $(MOZ_LTO_CFLAGS) $(COMPUTED_CXXFLAGS) $(PGO_CFLAGS) $(_DEPEND_CFLAGS) $(MK_COMPILE_DEFINES)