Bug 1043862 - Make the binaries target use the compile tier. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 29 Jul 2014 08:58:28 +0900
changeset 219355 0cd3fbbf21f8ff4c65b6097e662417f50388a8cd
parent 219354 22850cacf0f9527a7408375aa9270ebe835175a4
child 219356 e46b6092eb196d3f678e8bec85de7500ab174177
push id583
push userbhearsum@mozilla.com
push dateMon, 24 Nov 2014 19:04:58 +0000
treeherdermozilla-release@c107e74250f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1043862
milestone34.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 1043862 - Make the binaries target use the compile tier. r=gps
config/makefiles/target_binaries.mk
config/recurse.mk
config/rules.mk
python/mozbuild/mozbuild/action/link_deps.py
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/test/test_link_deps.py
security/build/Makefile.in
--- a/config/makefiles/target_binaries.mk
+++ b/config/makefiles/target_binaries.mk
@@ -1,97 +1,84 @@
 # -*- makefile -*-
 # vim:set ts=8 sw=8 sts=8 noet:
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-binaries libs:: $(SUBMAKEFILES) $(TARGETS)
 ifndef NO_DIST_INSTALL
 ifdef SHARED_LIBRARY
 ifdef IS_COMPONENT
+libs target:: $(SUBMAKEFILES) $(SHARED_LIBRARY)
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
 ifndef NO_COMPONENTS_MANIFEST
 	$(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest 'manifest components/components.manifest')
 	$(call py_action,buildlist,$(FINAL_TARGET)/components/components.manifest 'binary-component $(SHARED_LIBRARY)')
 endif
 endif # IS_COMPONENT
 endif # SHARED_LIBRARY
 endif # !NO_DIST_INSTALL
 
 ifndef NO_DIST_INSTALL
 
 ifneq (,$(strip $(PROGRAM)$(SIMPLE_PROGRAMS)))
 PROGRAMS_EXECUTABLES = $(SIMPLE_PROGRAMS) $(PROGRAM)
 PROGRAMS_DEST ?= $(FINAL_TARGET)
-PROGRAMS_TARGET := binaries libs target
+PROGRAMS_TARGET := libs target
 INSTALL_TARGETS += PROGRAMS
 endif
 
 ifdef LIBRARY
 ifdef DIST_INSTALL
 ifdef IS_COMPONENT
 $(error Shipping static component libs makes no sense.)
 else
 DIST_LIBRARY_FILES = $(LIBRARY)
 DIST_LIBRARY_DEST ?= $(DIST)/lib
-DIST_LIBRARY_TARGET = binaries libs target
+DIST_LIBRARY_TARGET = libs target
 INSTALL_TARGETS += DIST_LIBRARY
 endif
 endif # DIST_INSTALL
 endif # LIBRARY
 
 
 ifdef SHARED_LIBRARY
 ifndef IS_COMPONENT
 SHARED_LIBRARY_FILES = $(SHARED_LIBRARY)
 SHARED_LIBRARY_DEST ?= $(FINAL_TARGET)
-SHARED_LIBRARY_TARGET = binaries libs target
+SHARED_LIBRARY_TARGET = libs target
 INSTALL_TARGETS += SHARED_LIBRARY
 
 ifneq (,$(filter WINNT,$(OS_ARCH)))
 ifndef NO_INSTALL_IMPORT_LIBRARY
 IMPORT_LIB_FILES = $(IMPORT_LIBRARY)
 endif # NO_INSTALL_IMPORT_LIBRARY
 else
 IMPORT_LIB_FILES = $(SHARED_LIBRARY)
 endif
 
 IMPORT_LIB_DEST ?= $(DIST)/lib
-IMPORT_LIB_TARGET = binaries libs target
+IMPORT_LIB_TARGET = libs target
 ifdef IMPORT_LIB_FILES
 INSTALL_TARGETS += IMPORT_LIB
 endif
 
 endif # ! IS_COMPONENT
 endif # SHARED_LIBRARY
 
 ifneq (,$(strip $(HOST_SIMPLE_PROGRAMS)$(HOST_PROGRAM)))
 HOST_PROGRAMS_EXECUTABLES = $(HOST_SIMPLE_PROGRAMS) $(HOST_PROGRAM)
 HOST_PROGRAMS_DEST ?= $(DIST)/host/bin
-HOST_PROGRAMS_TARGET = binaries libs host
+HOST_PROGRAMS_TARGET = libs host
 INSTALL_TARGETS += HOST_PROGRAMS
 endif
 
 ifdef HOST_LIBRARY
 HOST_LIBRARY_FILES = $(HOST_LIBRARY)
 HOST_LIBRARY_DEST ?= $(DIST)/host/lib
-HOST_LIBRARY_TARGET = binaries libs host
+HOST_LIBRARY_TARGET = libs host
 INSTALL_TARGETS += HOST_LIBRARY
 endif
 
 endif # !NO_DIST_INSTALL
 
-BINARIES_INSTALL_TARGETS := $(foreach category,$(INSTALL_TARGETS),$(if $(filter binaries,$($(category)_TARGET)),$(category)))
-
-# Fill a dependency file with all the binaries installed somewhere in $(DIST)
-# and with dependencies on the relevant backend files.
-BINARIES_PP := $(MDDEPDIR)/binaries.pp
-
-$(BINARIES_PP): Makefile $(wildcard backend.mk) $(call mkdir_deps,$(MDDEPDIR))
-	@echo '$(strip $(foreach category,$(BINARIES_INSTALL_TARGETS),\
-		$(foreach file,$($(category)_FILES) $($(category)_EXECUTABLES),\
-			$($(category)_DEST)/$(notdir $(file)): $(file)%\
-		)\
-	))binaries: Makefile $(wildcard backend.mk)' | tr % '\n' > $@
-
 # EOF
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -31,27 +31,31 @@ ifeq (.,$(DEPTH))
 include root.mk
 
 # Disable build status for mach in top directories without TIERS.
 # In practice this disables it when recursing under js/src, which confuses mach.
 ifndef TIERS
 BUILDSTATUS =
 endif
 
-# Main rules (export, compile, binaries, libs and tools) call recurse_* rules.
+# Main rules (export, compile, libs and tools) call recurse_* rules.
 # This wrapping is only really useful for build status.
-compile binaries libs export tools::
+compile libs export tools::
 	$(call BUILDSTATUS,TIER_START $@)
 	+$(MAKE) recurse_$@
 	$(call BUILDSTATUS,TIER_FINISH $@)
 
+# Special rule that does install-manifests (cf. Makefile.in) + compile
+binaries::
+	+$(MAKE) recurse_compile
+
 # Carefully avoid $(eval) type of rule generation, which makes pymake slower
 # than necessary.
 # Get current tier and corresponding subtiers from the data in root.mk.
-CURRENT_TIER := $(filter $(foreach tier,compile binaries libs export tools,recurse_$(tier) $(tier)-deps),$(MAKECMDGOALS))
+CURRENT_TIER := $(filter $(foreach tier,compile libs export tools,recurse_$(tier) $(tier)-deps),$(MAKECMDGOALS))
 ifneq (,$(filter-out 0 1,$(words $(CURRENT_TIER))))
 $(error $(CURRENT_TIER) not supported on the same make command line)
 endif
 CURRENT_TIER := $(subst recurse_,,$(CURRENT_TIER:-deps=))
 
 # The rules here are doing directory traversal, so we don't want further
 # recursion to happen when running make -C subdir $tier. But some make files
 # further call make -C something else, and sometimes expect recursion to
@@ -66,42 +70,33 @@ export NO_RECURSE_MAKELEVEL=$(word $(MAK
 endif
 endif
 
 # Get all directories traversed for all subtiers in the current tier, or use
 # directly the $(*_dirs) variables available in root.mk when there is no
 # TIERS (like for js/src).
 CURRENT_DIRS := $($(CURRENT_TIER)_dirs)
 
-ifneq (,$(filter binaries libs,$(CURRENT_TIER)))
-WANT_STAMPS = 1
-STAMP_TOUCH = $(TOUCH) $(@D)/binaries
-endif
-
 # The compile tier has different rules from other tiers.
 ifeq ($(CURRENT_TIER),compile)
 
 # Need a list of compile targets because we can't use pattern rules:
 # https://savannah.gnu.org/bugs/index.php?42833
 .PHONY: $(compile_targets)
 $(compile_targets):
 	$(call SUBMAKE,$(if $(filter $(@D),$(staticdirs)),,$(@F)),$(@D))
 
 else
 
 # Recursion rule for all directories traversed for all subtiers in the
 # current tier.
 $(addsuffix /$(CURRENT_TIER),$(CURRENT_DIRS)): %/$(CURRENT_TIER):
 	$(call SUBMAKE,$(CURRENT_TIER),$*)
-# Ensure existing stamps are up-to-date, but don't create one if submake didn't create one.
-	$(if $(wildcard $@),@$(STAMP_TOUCH))
 
-ifndef STAMP_TOUCH
 .PHONY: $(addsuffix /$(CURRENT_TIER),$(CURRENT_DIRS))
-endif
 
 # Dummy rules for possibly inexisting dependencies for the above tier targets
 $(addsuffix /Makefile,$(CURRENT_DIRS)) $(addsuffix /backend.mk,$(CURRENT_DIRS)):
 
 ifeq ($(CURRENT_TIER),export)
 # At least build/export requires config/export for buildid, but who knows what
 # else, so keep this global dependency to make config/export first for now.
 $(addsuffix /$(CURRENT_TIER),$(filter-out config,$(CURRENT_DIRS))): config/$(CURRENT_TIER)
@@ -118,56 +113,22 @@ ifneq (,$(filter config/host, $(compile_
 .PHONY: $(filter %/host, $(compile_targets))
 $(filter %/host, $(compile_targets)):
 	$(call SUBMAKE,host,$(@D))
 endif
 endif
 
 endif # ifeq ($(CURRENT_TIER),compile)
 
-ifdef COMPILE_ENVIRONMENT
-# Disable dependency aggregation on PGO builds because of bug 934166.
-ifeq (,$(MOZ_PGO)$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
-ifneq (,$(filter libs binaries,$(CURRENT_TIER)))
-# When doing a "libs" build, target_libs.mk ensures the interesting dependency data
-# is available in the "binaries" stamp. Once recursion is done, aggregate all that
-# dependency info so that stamps depend on relevant files and relevant other stamps.
-# When doing a "binaries" build, the aggregate dependency file and those stamps are
-# used and allow to skip recursing directories where changes are not going to require
-# rebuild. A few directories, however, are still traversed all the time, mostly, the
-# gyp managed ones and js/src.
-# A few things that are not traversed by a "binaries" build, but should, in an ideal
-# world, are nspr, nss, icu and ffi.
-recurse_$(CURRENT_TIER):
-	@$(MAKE) binaries-deps
-
-# Creating binaries-deps.mk directly would make us build it twice: once when beginning
-# the build because of the include, and once at the end because of the stamps.
-binaries-deps:
-	@$(call py_action,link_deps,-o $@.mk --group-by-depfile --topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) --guard $(addprefix ',$(addsuffix ', $(wildcard $(addsuffix /binaries,$(CURRENT_DIRS))))))
-	@$(TOUCH) $@
-
-ifeq (recurse_binaries,$(MAKECMDGOALS))
-$(call include_deps,binaries-deps.mk)
-endif
-
-endif
-
-DIST_GARBAGE += binaries-deps.mk binaries-deps
-
-endif
-
-endif
-
 else
 
 # Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above
 ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
 
-compile binaries libs export tools::
+compile libs export tools::
 
 else
 #########################
 # Tier traversal handling
 #########################
 
 ifdef TIERS
 
@@ -183,43 +144,19 @@ else
 define CREATE_SUBTIER_TRAVERSAL_RULE
 .PHONY: $(1)
 
 $(1):: $$(SUBMAKEFILES)
 	$$(LOOP_OVER_DIRS)
 
 endef
 
-$(foreach subtier,export binaries libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
+$(foreach subtier,export libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
 
 endif # ifdef TIERS
 
 endif # ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
 
 endif # ifeq (.,$(DEPTH))
 
-ifdef COMPILE_ENVIRONMENT
-
-# Aggregate all dependency files relevant to a binaries build except in
-# the mozilla top-level directory.
-ifneq (.,$(DEPTH))
-ALL_DEP_FILES := \
-  $(BINARIES_PP) \
-  $(addsuffix .pp,$(addprefix $(MDDEPDIR)/,$(sort \
-    $(TARGETS) \
-    $(filter-out $(SOBJS) $(ASOBJS) $(EXCLUDED_OBJS),$(OBJ_TARGETS)) \
-  ))) \
-  $(NULL)
-endif
-
-binaries libs:: $(TARGETS) $(BINARIES_PP)
-# Disable dependency aggregation on PGO builds because of bug 934166.
-ifeq (,$(MOZ_PGO)$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
-ifneq (.,$(DEPTH))
-	@$(if $^,$(call py_action,link_deps,-o binaries --group-all --topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) $(ALL_DEP_FILES)))
-endif
-endif
-
-endif
-
 recurse:
 	@$(RECURSED_COMMAND)
 	$(LOOP_OVER_DIRS)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -82,17 +82,17 @@ ifdef COMPILE_ENVIRONMENT
 # which stuff links.
 SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS)
 INCLUDES += -I$(DIST)/include/testing
 LIBS += $(NSPR_LIBS)
 
 ifndef MOZ_PROFILE_GENERATE
 CPP_UNIT_TESTS_FILES = $(CPP_UNIT_TESTS)
 CPP_UNIT_TESTS_DEST = $(DIST)/cppunittests
-CPP_UNIT_TESTS_TARGET = binaries libs target
+CPP_UNIT_TESTS_TARGET = libs target
 INSTALL_TARGETS += CPP_UNIT_TESTS
 endif
 
 run-cppunittests::
 	@$(PYTHON) $(topsrcdir)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(CPP_UNIT_TESTS)
 
 cppunittests-remote: DM_TRANS?=adb
 cppunittests-remote:
@@ -229,17 +229,16 @@ ifeq ($(HOST_OS_ARCH),WINNT)
 HOST_PDBFILE=$(basename $(@F)).pdb
 HOST_PDB_FLAG ?= -Fd$(HOST_PDBFILE)
 HOST_CFLAGS += $(HOST_PDB_FLAG)
 HOST_CXXFLAGS += $(HOST_PDB_FLAG)
 endif
 
 # Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
 ifdef MOZ_PROFILE_GENERATE
-EXCLUDED_OBJS := $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX))
 SIMPLE_PROGRAMS :=
 endif
 
 ifdef COMPILE_ENVIRONMENT
 ifndef TARGETS
 TARGETS			= $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
 endif
 
@@ -779,17 +778,16 @@ ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
 else
 	$(EXPAND_LIBS_EXEC) -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif
 endif
 
 ifdef DTRACE_PROBE_OBJ
 EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
 OBJS += $(DTRACE_PROBE_OBJ)
-EXCLUDED_OBJS += $(DTRACE_PROBE_OBJ)
 endif
 
 $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(REPORT_BUILD)
 	$(RM) $(LIBRARY)
 	$(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(SHARED_LIBRARY_LIBS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS))
 
 $(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
@@ -1249,27 +1247,27 @@ endif
 
 ################################################################################
 # SDK
 
 ifneq (,$(SDK_LIBRARY))
 ifndef NO_DIST_INSTALL
 SDK_LIBRARY_FILES := $(SDK_LIBRARY)
 SDK_LIBRARY_DEST := $(SDK_LIB_DIR)
-SDK_LIBRARY_TARGET := binaries libs target
+SDK_LIBRARY_TARGET := libs target
 INSTALL_TARGETS += SDK_LIBRARY
 endif
 endif # SDK_LIBRARY
 
 ifneq (,$(strip $(SDK_BINARY)))
 ifndef NO_DIST_INSTALL
 SDK_BINARY_FILES := $(SDK_BINARY)
 SDK_BINARY_DEST := $(SDK_BIN_DIR)
 # SDK_BINARY_TARGET is set in xpcom/idl-parser/Makefile.in
-SDK_BINARY_TARGET ?= binaries libs target
+SDK_BINARY_TARGET ?= libs target
 INSTALL_TARGETS += SDK_BINARY
 endif
 endif # SDK_BINARY
 
 ################################################################################
 # CHROME PACKAGING
 
 chrome::
deleted file mode 100644
--- a/python/mozbuild/mozbuild/action/link_deps.py
+++ /dev/null
@@ -1,229 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-'''
-Read dependency Makefiles and merge them together. Also normalizes paths
-relative to a given topobjdir and topsrcdir, and drops files outside topobjdir
-and topsrcdir.
-
-The build creates many .pp files under .deps directories. Those contain
-specific dependencies for individual targets.
-
-As an example, let's say we have a tree like the following:
-  foo/ contains foo1.cpp and foo2.cpp, built, respectively, as foo1.o and
-  foo2.o, and depending on foo.h, in the same directory, and bar.h in a bar/
-  directory.
-  bar/ contains bar.cpp, built as bar.cpp, and depending on bar.h.
-  build/ contains no source, but builds a libfoobar.a library from foo1.o,
-  foo2.o and bar.o.
-
-In that example, we have .pp files like the following (ignoring removal
-guards):
-  foo/.deps/foo1.o.pp:
-    foo1.o: /path/to/foo/foo1.cpp /path/to/foo/foo.h \
-            /path/to/bar/bar.h /usr/include/some/system/headers
-  foo/.deps/foo2.o.pp:
-    foo2.o: /path/to/foo/foo2.cpp /path/to/foo/foo.h \
-            /path/to/bar/bar.h /usr/include/some/system/headers
-  bar/.deps/bar.o.pp:
-    bar.o: /path/to/bar/bar.cpp /path/to/bar/bar.h \
-           /usr/include/some/system/headers
-  build/.deps/libfoobar.a.pp:
-    libfoobar.a: ../foo/foo1.o ../foo/foo2.o ../bar/bar.o
-
-The first stage is to group and normalize all dependencies per directory.
-This is the Grouping.ALL_TARGETS case.
-
-The intermediate result would be:
-  foo/binaries:
-    $(DEPTH)/foo/foo1.o $(DEPTH)/foo/foo2.o: $(topsrcdir)/foo/foo1.cpp \
-      $(topsrcdir)/foo/foo2.cpp $(topsrcdir)/foo/foo.h $(topsrcdir)/bar/bar.h
-  bar/binaries:
-    $(DEPTH)/bar/bar.o: $(topsrcdir)/bar/bar.cpp $(topsrcdir)/bar/bar.h
-  build/binaries:
-    $(DEPTH)/build/libfoobar.a: $(DEPTH)/foo/foo1.o $(DEPTH)/foo/foo2.o \
-      $(DEPTH)/bar/bar.o
-
-Those files are not meant to be directly included by a Makefile, so the broad
-dependencies they represent is not a problem. But it helps making the next step
-faster, by reading less and smaller files.
-
-The second stage is grouping those rules by file they are defined in. This
-means replacing occurrences of, e.g. $(DEPTH)/foo/foo1.o with the file that
-defines $(DEPTH)/foo/foo1.o as a target, which is $(DEPTH)/foo/binaries.
-
-The end result would thus be:
-  binaries-deps.mk:
-    $(DEPTH)/foo/binaries: $(topsrcdir)/foo/foo1.cpp \
-      $(topsrcdir)/foo/foo2.cpp $(topsrcdir)/foo/foo.h \
-      $(topsrcdir)/bar/bar.h
-    $(DEPTH)/bar/binaries: $(topsrcdir)/bar/bar.cpp $(topsrcdir)/bar/bar.h
-    $(DEPTH)/build/binaries: $(DEPTH)/foo/binaries $(DEPTH)/bar/binaries
-
-A change in foo/foo1.cpp would then trigger a rebuild of foo/binaries and
-build/binaries.
-'''
-
-import argparse
-import os
-import sys
-from collections import OrderedDict
-from mozbuild.makeutil import (
-    Makefile,
-    read_dep_makefile,
-)
-import mozpack.path as mozpath
-
-
-def enum(**enums):
-    return type('Enum', (), enums)
-
-
-Grouping = enum(NO=0, BY_DEPFILE=1, ALL_TARGETS=2)
-
-
-class DependencyLinker(Makefile):
-    def __init__(self, topsrcdir, topobjdir, dist, group=Grouping.NO,
-                 abspaths=False):
-        topsrcdir = mozpath.normsep(os.path.normcase(os.path.abspath(topsrcdir)))
-        topobjdir = mozpath.normsep(os.path.normcase(os.path.abspath(topobjdir)))
-        dist = mozpath.normsep(os.path.normcase(os.path.abspath(dist)))
-        if abspaths:
-            topsrcdir_value = topsrcdir
-            topobjdir_value = topobjdir
-            dist_value = dist
-        else:
-            topsrcdir_value = '$(topsrcdir)'
-            topobjdir_value = '$(DEPTH)'
-            dist_value = '$(DIST)'
-
-        self._normpaths = {
-            topsrcdir: topsrcdir_value,
-            topobjdir: topobjdir_value,
-            dist: dist_value,
-            '$(topsrcdir)': topsrcdir_value,
-            '$(DEPTH)': topobjdir_value,
-            '$(DIST)': dist_value,
-            '$(depth)': topobjdir_value, # normcase may lowercase variable refs when
-            '$(dist)': dist_value,       # they are in the original dependency file
-            mozpath.relpath(topobjdir, os.curdir): topobjdir_value,
-            mozpath.relpath(dist, os.curdir): dist_value,
-        }
-        try:
-            # mozpath.relpath(topsrcdir, os.curdir) fails when source directory
-            # and object directory are not on the same drive on Windows. In
-            # this case, the value is not useful in self._normpaths anyways.
-            self._normpaths[mozpath.relpath(topsrcdir, os.curdir)] = topsrcdir_value
-        except ValueError:
-            pass
-
-        Makefile.__init__(self)
-        self._group = group
-        self._targets = OrderedDict()
-
-    def add_dependencies(self, fh):
-        depfile = self.normpath(os.path.abspath(fh.name))
-        for rule in read_dep_makefile(fh):
-            deps = list(rule.dependencies())
-            if deps:
-                deps = list(self.normpaths(deps))
-                for t in self.normpaths(rule.targets()):
-                    if t in self._targets:
-                        raise Exception('Found target %s in %s and %s'
-                                        % (t, self._targets[t][0], depfile))
-                    self._targets[t] = (depfile, deps)
-
-    def dump(self, fh, removal_guard=True):
-        rules = {}
-        for t, (depfile, deps) in self._targets.items():
-            if self._group == Grouping.BY_DEPFILE:
-                if depfile not in rules:
-                    rules[depfile] = self.create_rule([depfile])
-                rules[depfile].add_dependencies(d if d not in self._targets else self._targets[d][0] for d in deps)
-            elif self._group == Grouping.ALL_TARGETS:
-                if 'all' not in rules:
-                    rules['all'] = self.create_rule()
-                rules['all'].add_targets([t]) \
-                            .add_dependencies(deps)
-            elif self._group == Grouping.NO:
-                self.create_rule([t]) \
-                    .add_dependencies(deps)
-        Makefile.dump(self, fh, removal_guard)
-
-    # os.path.abspath is slow, especially when run hundred of thousands of
-    # times with a lot of times the same path or partial path, so cleverly
-    # cache results and partial results.
-    def normpath(self, path):
-        key = mozpath.normsep(os.path.normcase(path))
-        result = self._normpaths.get(key, False)
-        if result != False:
-            return result
-        dir, file = os.path.split(path)
-        if file in ['.', '..']:
-            result = self.normpath(os.path.abspath(path))
-            self._normpaths[key] = result
-            return result
-        if dir != path:
-            if dir == '':
-               dir = '.'
-            d = self.normpath(dir)
-            if d:
-                result = '%s/%s' % (d, os.path.basename(path))
-                self._normpaths[key] = result
-                return result
-        self._normpaths[key] = None
-        return None
-
-    def normpaths(self, paths):
-        for p in paths:
-            r = self.normpath(p)
-            if r:
-                yield r
-
-
-def main(args):
-    parser = argparse.ArgumentParser(description='Link dependency files.')
-    parser.add_argument('--topsrcdir', required=True,
-        help='Path to the top-level source directory.')
-    parser.add_argument('--topobjdir', required=True,
-        help='Path to the top-level object directory.')
-    parser.add_argument('--dist', required=True,
-        help='Path to the dist directory.')
-    parser.add_argument('-o', '--output',
-        help='Send output to the given file.')
-    parser.add_argument('dependency_files', nargs='*')
-    parser.add_argument('--guard', action="store_true",
-        help='Add removal guards in the linked result.')
-    group = parser.add_mutually_exclusive_group()
-    group.add_argument('--group-by-depfile', action='store_true',
-        help='Group dependencies by depfile.')
-    group.add_argument('--group-all', action='store_true',
-        help='Group all dependencies under one target.')
-    parser.add_argument('--abspaths', action='store_true',
-        help='Use absolute paths instead of using make variable references.')
-    opts = parser.parse_args(args)
-
-    if opts.group_by_depfile:
-        group = Grouping.BY_DEPFILE
-    elif opts.group_all:
-        group = Grouping.ALL_TARGETS
-    else:
-        group = Grouping.NO
-    linker = DependencyLinker(topsrcdir=opts.topsrcdir,
-                              topobjdir=opts.topobjdir,
-                              dist=opts.dist,
-                              group=group,
-                              abspaths=opts.abspaths)
-    for f in opts.dependency_files:
-        linker.add_dependencies(open(f))
-
-    if opts.output:
-        out = open(opts.output, 'w')
-    else:
-        out = sys.stdout
-    linker.dump(out, removal_guard=opts.guard)
-
-
-if __name__ == '__main__':
-    main(sys.argv[1:])
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -322,17 +322,16 @@ class RecursiveMakeBackend(CommonBackend
             ]}
 
         self._traversal = RecursiveMakeTraversal()
         self._compile_graph = defaultdict(set)
         self._triggers = defaultdict(set)
 
         self._may_skip = {
             'export': set(),
-            'binaries': set(),
             'libs': set(),
         }
         self._no_skip = {
             'tools': set(),
         }
 
     def consume_object(self, obj):
         """Write out build files necessary to build with recursive make."""
@@ -533,20 +532,18 @@ class RecursiveMakeBackend(CommonBackend
         # this tier anyways.
         def tools_filter(current, subdirs):
             if current not in self._no_skip['tools'] \
                     or current.startswith('subtiers/'):
                 current = None
             return current, [], subdirs.parallel + \
                 subdirs.dirs + subdirs.tests
 
-        # compile, binaries and tools tiers use the same traversal as export
         filters = [
             ('export', parallel_filter),
-            ('binaries', parallel_filter),
             ('libs', libs_filter),
             ('tools', tools_filter),
         ]
 
         root_deps_mk = Makefile()
 
         # Fill the dependencies for traversal of each tier.
         for tier, filter in filters:
@@ -699,18 +696,16 @@ class RecursiveMakeBackend(CommonBackend
                 # create a stub.
                 stub = not os.path.exists(makefile_in)
                 if not stub:
                     self.log(logging.DEBUG, 'substitute_makefile',
                         {'path': makefile}, 'Substituting makefile: {path}')
                     self.summary.makefile_in_count += 1
 
                     for tier, skiplist in self._may_skip.items():
-                        if tier in ('compile', 'binaries'):
-                            continue
                         if bf.relobjdir in skiplist:
                             skiplist.remove(bf.relobjdir)
                 else:
                     self.log(logging.DEBUG, 'stub_makefile',
                         {'path': makefile}, 'Creating stub Makefile: {path}')
 
                 obj = self.Substitution()
                 obj.output_path = makefile
deleted file mode 100644
--- a/python/mozbuild/mozbuild/test/test_link_deps.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import mozunit
-import os
-import unittest
-from collections import OrderedDict
-from mozbuild.action.link_deps import (
-    DependencyLinker,
-    Grouping,
-)
-from mozbuild.makeutil import Makefile
-from StringIO import StringIO
-
-
-class TestDependencyLinker(unittest.TestCase):
-    def setUp(self):
-        self._cwd = os.getcwd()
-        os.chdir(os.path.dirname(__file__))
-
-    def tearDown(self):
-        os.chdir(self._cwd)
-
-    def gen_depfile(self, name, rules):
-        mk = Makefile()
-        for target, deps in rules.items():
-            mk.create_rule([target]) \
-              .add_dependencies(deps)
-        depfile = StringIO()
-        mk.dump(depfile, removal_guard=True)
-        depfile.seek(0)
-        depfile.name = name
-        return depfile
-
-    def test_dependency_linker(self):
-        linker = DependencyLinker(
-            topsrcdir=os.path.abspath(os.path.join(os.pardir, os.pardir)),
-            topobjdir=os.path.abspath(os.pardir),
-            dist=os.path.abspath(os.path.join(os.pardir, 'dist'))
-        )
-        linker.add_dependencies(self.gen_depfile('.deps/foo.o.pp', {'foo.o': [
-            '../../foo/foo.cpp',
-            '/usr/include/stdint.h',
-            '../dist/include/bar.h',
-            '../qux_gen/qux.h',
-            '../../hoge/hoge.h'
-        ]}))
-
-        linker.add_dependencies(self.gen_depfile('.deps/bar.o.pp', {'bar.o': [
-            '../../foo/bar.cpp',
-            '/usr/include/stdint.h',
-            '../dist/include/bar.h',
-            '../../foo/foo.h',
-            '../../hoge/hoge.h'
-        ]}))
-
-        result = StringIO()
-        linker.dump(result)
-
-        self.assertEqual(result.getvalue().splitlines(), [
-            '$(DEPTH)/test/foo.o: $(topsrcdir)/foo/foo.cpp '
-                '$(DIST)/include/bar.h $(DEPTH)/qux_gen/qux.h '
-                '$(topsrcdir)/hoge/hoge.h',
-            '$(DEPTH)/test/bar.o: $(topsrcdir)/foo/bar.cpp '
-                '$(DIST)/include/bar.h $(topsrcdir)/foo/foo.h '
-                '$(topsrcdir)/hoge/hoge.h',
-            '$(DEPTH)/qux_gen/qux.h $(DIST)/include/bar.h '
-                '$(topsrcdir)/foo/bar.cpp $(topsrcdir)/foo/foo.cpp '
-                '$(topsrcdir)/foo/foo.h $(topsrcdir)/hoge/hoge.h:'
-        ])
-
-    def test_dependency_grouping(self):
-        linker = DependencyLinker(
-            topsrcdir=os.path.abspath(os.path.join(os.pardir, os.pardir)),
-            topobjdir=os.path.abspath(os.pardir),
-            dist=os.path.abspath(os.path.join(os.pardir, 'dist')),
-            group=Grouping.ALL_TARGETS
-        )
-        linker.add_dependencies(self.gen_depfile('.deps/foo.o.pp', {'foo.o': [
-            '../../foo/foo.cpp',
-            '/usr/include/stdint.h',
-            '../dist/include/bar.h',
-            '../qux_gen/qux.h',
-            '../../hoge/hoge.h'
-        ]}))
-
-        linker.add_dependencies(self.gen_depfile('.deps/bar.o.pp', {'bar.o': [
-            '../../foo/bar.cpp',
-            '/usr/include/stdint.h',
-            '../dist/include/bar.h',
-            '../../foo/foo.h',
-            '../../hoge/hoge.h'
-        ]}))
-
-        result = StringIO()
-        linker.dump(result)
-
-        self.assertEqual(result.getvalue().splitlines(), [
-            '$(DEPTH)/test/foo.o $(DEPTH)/test/bar.o: '
-                '$(topsrcdir)/foo/foo.cpp $(DIST)/include/bar.h '
-                '$(DEPTH)/qux_gen/qux.h $(topsrcdir)/hoge/hoge.h '
-                '$(topsrcdir)/foo/bar.cpp $(topsrcdir)/foo/foo.h',
-            '$(DEPTH)/qux_gen/qux.h $(DIST)/include/bar.h '
-                '$(topsrcdir)/foo/bar.cpp $(topsrcdir)/foo/foo.cpp '
-                '$(topsrcdir)/foo/foo.h $(topsrcdir)/hoge/hoge.h:'
-        ])
-
-    def test_dependency_by_depfile(self):
-        linker = DependencyLinker(
-            topsrcdir=os.path.abspath(os.pardir),
-            topobjdir=os.path.abspath(os.curdir),
-            dist=os.path.abspath('dist'),
-            group=Grouping.BY_DEPFILE
-        )
-        linker.add_dependencies(self.gen_depfile('foo/binaries', OrderedDict([
-            ('$(DEPTH)/foo/foo.o', [
-                '$(topsrcdir)/foo/foo.cpp',
-                '$(DIST)/include/bar.h',
-                '$(DEPTH)/qux_gen/qux.h',
-                '$(topsrcdir)/hoge/hoge.h',
-            ]),
-            ('$(DEPTH)/foo/bar.o', [
-                '$(topsrcdir)/foo/bar.cpp',
-                '$(DIST)/include/bar.h',
-                '$(topsrcdir)/foo/foo.h',
-                '$(topsrcdir)/hoge/hoge.h',
-            ]),
-            ('$(DEPTH)/foo/foobar.lib', [
-                '$(DEPTH)/foo/foo.o',
-                '$(DEPTH)/foo/bar.o',
-            ]),
-            ('$(DIST)/lib/foobar.lib', [ '$(DEPTH)/foo/foobar.lib' ]),
-        ])))
-        linker.add_dependencies(self.gen_depfile('hoge/binaries', OrderedDict([
-            ('$(DEPTH)/hoge/hoge.exe', [
-                '$(DEPTH)/hoge/hoge.o',
-                '$(DIST)/lib/foobar.lib',
-            ]),
-            ('$(DEPTH)/hoge/hoge.o', [
-                '$(topsrcdir)/hoge/hoge.cpp',
-                '$(topsrcdir)/hoge/hoge.h',
-            ]),
-        ])))
-
-        result = StringIO()
-        linker.dump(result, removal_guard=False)
-
-        self.assertEqual(result.getvalue().splitlines(), [
-            '$(DEPTH)/foo/binaries: $(topsrcdir)/foo/foo.cpp '
-                '$(DIST)/include/bar.h $(DEPTH)/qux_gen/qux.h '
-                '$(topsrcdir)/hoge/hoge.h $(topsrcdir)/foo/bar.cpp '
-                '$(topsrcdir)/foo/foo.h',
-            '$(DEPTH)/hoge/binaries: $(DEPTH)/foo/binaries '
-                '$(topsrcdir)/hoge/hoge.cpp $(topsrcdir)/hoge/hoge.h',
-        ])
-
-if __name__ == '__main__':
-    mozunit.main()
--- a/security/build/Makefile.in
+++ b/security/build/Makefile.in
@@ -298,30 +298,30 @@ NSS_DIRS += nss/lib/freebl nss/lib/softo
 ifeq (WINNT,$(OS_TARGET))
 NSS_DIRS += nss/lib/zlib
 endif
 endif # MOZ_FOLD_LIBS
 
 # Filter-out $(LIBRARY_NAME) because it's already handled in config/rules.mk.
 NSS_DIST_DLL_FILES := $(addprefix $(DIST)/lib/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(filter-out $(LIBRARY_NAME),$(NSS_DLLS)) $(NSS_EXTRA_DLLS)))
 NSS_DIST_DLL_DEST := $(DIST)/bin
-NSS_DIST_DLL_TARGET := binaries libs target
+NSS_DIST_DLL_TARGET := libs target
 INSTALL_TARGETS += NSS_DIST_DLL
 
 ifeq ($(OS_ARCH)_$(1), SunOS_softokn3)
 # has to use copy mode on Solaris, see #665509
 $(DIST)/bin/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): INSTALL := $(INSTALL) -t
 endif
 
 NSS_SDK_LIB_FILES := \
   $(addprefix $(DIST)/lib/$(LIB_PREFIX),$(addsuffix .$(LIB_SUFFIX),$(SDK_LIBS))) \
   $(addprefix $(DIST)/bin/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(NSS_DLLS))) \
   $(NULL)
 NSS_SDK_LIB_DEST := $(DIST)/sdk/lib
-NSS_SDK_LIB_TARGET := binaries libs target
+NSS_SDK_LIB_TARGET := libs target
 INSTALL_TARGETS += NSS_SDK_LIB
 
 ifdef MOZ_FOLD_LIBS
 ifeq (WINNT,$(OS_TARGET))
 SUFFIX = _s.$(LIB_SUFFIX)
 else
 SUFFIX = .$(LIB_SUFFIX)
 endif