diff options
-rw-r--r-- | build/win32/pgomerge.py | 40 | ||||
-rw-r--r-- | config/config.mk | 2 | ||||
-rw-r--r-- | config/rules.mk | 37 |
3 files changed, 0 insertions, 79 deletions
diff --git a/build/win32/pgomerge.py b/build/win32/pgomerge.py deleted file mode 100644 index 383457bf..00000000 --- a/build/win32/pgomerge.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/python -# Usage: pgomerge.py <binary basename> <dist/bin> -# Gathers .pgc files from dist/bin and merges them into -# $PWD/$basename.pgd using pgomgr, then deletes them. -# No errors if any of these files don't exist. - -import sys, os, os.path, subprocess -if not sys.platform == "win32": - raise Exception("This script was only meant for Windows.") - -def MergePGOFiles(basename, pgddir, pgcdir): - """Merge pgc files produced from an instrumented binary - into the pgd file for the second pass of profile-guided optimization - with MSVC. |basename| is the name of the DLL or EXE without the - extension. |pgddir| is the path that contains <basename>.pgd - (should be the objdir it was built in). |pgcdir| is the path - containing basename!N.pgc files, which is probably dist/bin. - Calls pgomgr to merge each pgc file into the pgd, then deletes - the pgc files.""" - if not os.path.isdir(pgddir) or not os.path.isdir(pgcdir): - return - pgdfile = os.path.abspath(os.path.join(pgddir, basename + ".pgd")) - if not os.path.isfile(pgdfile): - return - for file in os.listdir(pgcdir): - if file.startswith(basename+"!") and file.endswith(".pgc"): - try: - pgcfile = os.path.normpath(os.path.join(pgcdir, file)) - subprocess.call(['pgomgr', '-merge', - pgcfile, - pgdfile]) - os.remove(pgcfile) - except OSError: - pass - -if __name__ == '__main__': - if len(sys.argv) != 3: - print >>sys.stderr, "Usage: pgomerge.py <binary basename> <dist/bin>" - sys.exit(1) - MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2]) diff --git a/config/config.mk b/config/config.mk index cfb9f3f2..f47d8fee 100644 --- a/config/config.mk +++ b/config/config.mk @@ -78,13 +78,11 @@ LDFLAGS = $(OS_LDFLAGS) ifdef MOZ_PROFILE_GENERATE CFLAGS += $(PROFILE_GEN_CFLAGS) LDFLAGS += $(PROFILE_GEN_LDFLAGS) -DLLFLAGS += $(PROFILE_GEN_LDFLAGS) endif # MOZ_PROFILE_GENERATE ifdef MOZ_PROFILE_USE CFLAGS += $(PROFILE_USE_CFLAGS) LDFLAGS += $(PROFILE_USE_LDFLAGS) -DLLFLAGS += $(PROFILE_USE_LDFLAGS) endif # MOZ_PROFILE_USE define MAKE_OBJDIR diff --git a/config/rules.mk b/config/rules.mk index a8ee1954..344ad2e5 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -280,13 +280,6 @@ $(NFSPWD): $(PROGRAM): $(OBJS) @$(MAKE_OBJDIR) ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) -ifdef MOZ_PROFILE_USE -# In the second pass, we need to merge the pgc files into the pgd file. -# The compiler would do this for us automatically if they were in the right -# place, but they're in dist/bin. - python $(topsrcdir)/build/win32/pgomerge.py \ - $(notdir $(PROGRAM:.exe=)) $(DIST)/bin -endif # MOZ_PROFILE_USE $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) ifdef MT @if test -f $@.manifest; then \ @@ -294,11 +287,6 @@ ifdef MT rm -f $@.manifest; \ fi endif # MSVC with manifest tool -ifdef MOZ_PROFILE_GENERATE -# touch it a few seconds into the future to work around FAT's -# 2-second granularity - touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink -endif # MOZ_PROFILE_GENERATE else # WINNT && !GCC $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) endif # WINNT && !GCC @@ -338,10 +326,6 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) else # AIX 4.1 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) -ifdef MOZ_PROFILE_USE - python $(topsrcdir)/build/win32/pgomerge.py \ - $(notdir $(SHARED_LIBRARY:.$(DLL_SUFFIX)=)) $(DIST)/bin -endif # MOZ_PROFILE_USE $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES) ifdef MT @if test -f $@.manifest; then \ @@ -349,9 +333,6 @@ ifdef MT rm -f $@.manifest; \ fi endif # MSVC with manifest tool -ifdef MOZ_PROFILE_GENERATE - touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink -endif # MOZ_PROFILE_GENERATE else # WINNT && !GCC $(MKSHLIB) $(OBJS) $(RES) $(LDFLAGS) $(EXTRA_LIBS) endif # WINNT && !GCC @@ -360,24 +341,6 @@ ifdef ENABLE_STRIP $(STRIP) $@ endif -################################################################################ - -ifdef MOZ_PROFILE_USE -ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) -# When building with PGO, we have to make sure to re-link -# in the MOZ_PROFILE_USE phase if we linked in the -# MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink -# file in the link rule in the GENERATE phase to indicate -# that we need a relink. -$(SHARED_LIBRARY): pgo.relink - -$(PROGRAM): pgo.relink - -endif # WINNT && !GCC -endif # MOZ_PROFILE_USE - -################################################################################ - ifeq ($(OS_ARCH),WINNT) $(RES): $(RESNAME) @$(MAKE_OBJDIR) |