|
@@ -10,7 +10,7 @@ MozReview-Commit-ID: 8PtgxfbxuE
|
|
|
diff --git a/config/config.mk b/config/config.mk
|
|
|
--- a/config/config.mk
|
|
|
+++ b/config/config.mk
|
|
|
-@@ -415,25 +415,28 @@ endif
|
|
|
+@@ -436,25 +436,28 @@ endif
|
|
|
|
|
|
# MDDEPDIR is the subdirectory where dependency files are stored
|
|
|
MDDEPDIR := .deps
|
|
@@ -43,7 +43,7 @@ diff --git a/config/config.mk b/config/config.mk
|
|
|
diff --git a/config/rules.mk b/config/rules.mk
|
|
|
--- a/config/rules.mk
|
|
|
+++ b/config/rules.mk
|
|
|
-@@ -553,17 +553,17 @@ endif
|
|
|
+@@ -545,17 +545,17 @@ endif
|
|
|
#
|
|
|
# PROGRAM = Foo
|
|
|
# creates OBJS, links with LIBS to create Foo
|
|
@@ -52,17 +52,17 @@ diff --git a/config/rules.mk b/config/rules.mk
|
|
|
$(REPORT_BUILD)
|
|
|
@$(RM) $@.manifest
|
|
|
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
|
|
|
-- $(LINKER) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
|
|
|
+- $(LINKER) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS
|
|
|
+ $(LINKER) -NOLOGO -OUT:$(call LINKER_OUT,$@) -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_$(OBJS_VAR_SUFFIX)) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
|
|
|
ifdef MSMANIFEST_TOOL
|
|
|
- @if test -f $@.manifest; then \
|
|
|
- if test -f '$(srcdir)/$(notdir $@).manifest'; then \
|
|
|
- echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
|
|
|
- $(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
|
|
|
+ if test -f '$(srcdir)/$(notdir $@).manifest'; then \
|
|
|
+ echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
|
|
|
+ $(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
|
|
|
else \
|
|
|
echo 'Embedding manifest from $@.manifest'; \
|
|
|
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
|
|
|
-@@ -574,17 +574,17 @@ ifdef MSMANIFEST_TOOL
|
|
|
+ fi; \
|
|
|
+@@ -565,17 +565,17 @@ ifdef MSMANIFEST_TOOL
|
|
|
fi
|
|
|
endif # MSVC with manifest tool
|
|
|
ifdef MOZ_PROFILE_GENERATE
|
|
@@ -81,7 +81,7 @@ diff --git a/config/rules.mk b/config/rules.mk
|
|
|
endif
|
|
|
ifdef MOZ_POST_PROGRAM_COMMAND
|
|
|
$(MOZ_POST_PROGRAM_COMMAND) $@
|
|
|
-@@ -625,25 +625,25 @@ endif
|
|
|
+@@ -616,25 +616,25 @@ endif
|
|
|
# Foo.o (from either Foo.c or Foo.cpp).
|
|
|
#
|
|
|
# SIMPLE_PROGRAMS = Foo Bar
|
|
@@ -109,7 +109,7 @@ diff --git a/config/rules.mk b/config/rules.mk
|
|
|
endif
|
|
|
ifdef MOZ_POST_PROGRAM_COMMAND
|
|
|
$(MOZ_POST_PROGRAM_COMMAND) $@
|
|
|
-@@ -662,17 +662,17 @@ endif
|
|
|
+@@ -653,17 +653,17 @@ endif
|
|
|
endif
|
|
|
ifndef CROSS_COMPILE
|
|
|
$(call py_action,check_binary,--host $@)
|
|
@@ -118,7 +118,7 @@ diff --git a/config/rules.mk b/config/rules.mk
|
|
|
$(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
|
|
|
$(REPORT_BUILD)
|
|
|
$(RM) $(REAL_LIBRARY)
|
|
|
-- $(AR) $(AR_FLAGS) $(OBJS) $($@_OBJS)
|
|
|
+- $(AR) $(AR_FLAGS) $(OBJS) $($@_OBJS)
|
|
|
+ $(AR) $(AR_FLAGS) $(OBJS) $($@_$(OBJS_VAR_SUFFIX))
|
|
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
@@ -128,7 +128,7 @@ diff --git a/config/rules.mk b/config/rules.mk
|
|
|
# when rebuilding the corresponding shared library. Defining an empty recipe
|
|
|
# for import libraries forces make to wait for the shared library recipe to
|
|
|
# have run before considering other targets that depend on the import library.
|
|
|
-@@ -690,17 +690,17 @@ endif
|
|
|
+@@ -681,17 +681,17 @@ endif
|
|
|
# symlinks back to the originals. The symlinks are a no-op for stabs debugging,
|
|
|
# so no need to conditionalize on OS version or debugging format.
|
|
|
|
|
@@ -150,7 +150,7 @@ diff --git a/config/rules.mk b/config/rules.mk
|
|
|
diff --git a/python/mozbuild/mozbuild/backend/common.py b/python/mozbuild/mozbuild/backend/common.py
|
|
|
--- a/python/mozbuild/mozbuild/backend/common.py
|
|
|
+++ b/python/mozbuild/mozbuild/backend/common.py
|
|
|
-@@ -203,25 +203,31 @@ class CommonBackend(BuildBackend):
|
|
|
+@@ -357,25 +357,31 @@ class CommonBackend(BuildBackend):
|
|
|
}
|
|
|
json.dump(d, fh, sort_keys=True, indent=4)
|
|
|
|
|
@@ -182,7 +182,7 @@ diff --git a/python/mozbuild/mozbuild/backend/common.py b/python/mozbuild/mozbui
|
|
|
recurse_objs = False
|
|
|
elif recurse_objs:
|
|
|
add_objs(lib)
|
|
|
-@@ -253,17 +259,17 @@ class CommonBackend(BuildBackend):
|
|
|
+@@ -407,17 +413,17 @@ class CommonBackend(BuildBackend):
|
|
|
seen_libs.add(lib)
|
|
|
shared_libs.append(lib)
|
|
|
|
|
@@ -204,7 +204,7 @@ diff --git a/python/mozbuild/mozbuild/backend/common.py b/python/mozbuild/mozbui
|
|
|
diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
|
|
|
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
|
|
|
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
|
|
|
-@@ -1315,43 +1315,78 @@ class RecursiveMakeBackend(CommonBackend
|
|
|
+@@ -1281,43 +1281,78 @@ class RecursiveMakeBackend(CommonBackend
|
|
|
def pretty_relpath(lib):
|
|
|
return '$(DEPTH)/%s' % mozpath.relpath(lib.objdir, topobjdir)
|
|
|
|
|
@@ -292,7 +292,7 @@ diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild
|
|
|
diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
|
|
|
--- a/python/mozbuild/mozbuild/frontend/data.py
|
|
|
+++ b/python/mozbuild/mozbuild/frontend/data.py
|
|
|
-@@ -383,26 +383,30 @@ class LinkageMultipleRustLibrariesError(
|
|
|
+@@ -347,16 +347,18 @@ class LinkageMultipleRustLibrariesError(
|
|
|
|
|
|
class Linkable(ContextDerived):
|
|
|
"""Generic context derived container object for programs and libraries"""
|
|
@@ -303,7 +303,6 @@ diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuil
|
|
|
'linked_system_libs',
|
|
|
+ 'no_pgo_sources',
|
|
|
+ 'no_pgo',
|
|
|
- 'sources',
|
|
|
)
|
|
|
|
|
|
def __init__(self, context):
|
|
@@ -312,75 +311,3 @@ diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuil
|
|
|
self.linked_libraries = []
|
|
|
self.linked_system_libs = []
|
|
|
self.lib_defines = Defines(context, {})
|
|
|
- self.sources = defaultdict(list)
|
|
|
-+ self.no_pgo_sources = []
|
|
|
-+ self.no_pgo = False
|
|
|
-
|
|
|
- def link_library(self, obj):
|
|
|
- assert isinstance(obj, BaseLibrary)
|
|
|
- if obj.KIND != self.KIND:
|
|
|
- raise LinkageWrongKindError('%s != %s' % (obj.KIND, self.KIND))
|
|
|
- # Linking multiple Rust libraries into an object would result in
|
|
|
- # multiple copies of the Rust standard library, as well as linking
|
|
|
- # errors from duplicate symbols.
|
|
|
-@@ -432,26 +436,33 @@ class Linkable(ContextDerived):
|
|
|
- def source_files(self):
|
|
|
- all_sources = []
|
|
|
- # This is ordered for reproducibility and consistently w/
|
|
|
- # config/rules.mk
|
|
|
- for suffix in ('.c', '.S', '.cpp', '.m', '.mm', '.s'):
|
|
|
- all_sources += self.sources.get(suffix, [])
|
|
|
- return all_sources
|
|
|
-
|
|
|
-- @property
|
|
|
-- def objs(self):
|
|
|
-+ def _get_objs(self, sources):
|
|
|
- obj_prefix = ''
|
|
|
- if self.KIND == 'host':
|
|
|
- obj_prefix = 'host_'
|
|
|
-
|
|
|
- return [mozpath.join(self.objdir, '%s%s.%s' % (obj_prefix,
|
|
|
- mozpath.splitext(mozpath.basename(f))[0],
|
|
|
- self.config.substs.get('OBJ_SUFFIX', '')))
|
|
|
-- for f in self.source_files()]
|
|
|
-+ for f in sources]
|
|
|
-+
|
|
|
-+ @property
|
|
|
-+ def no_pgo_objs(self):
|
|
|
-+ return self._get_objs(self.no_pgo_sources)
|
|
|
-+
|
|
|
-+ @property
|
|
|
-+ def objs(self):
|
|
|
-+ return self._get_objs(self.source_files())
|
|
|
-
|
|
|
-
|
|
|
- class BaseProgram(Linkable):
|
|
|
- """Context derived container object for programs, which is a unicode
|
|
|
- string.
|
|
|
-
|
|
|
- This class handles automatically appending a binary suffix to the program
|
|
|
- name.
|
|
|
-diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
---- a/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
-+++ b/python/mozbuild/mozbuild/frontend/emitter.py
|
|
|
-@@ -946,16 +946,20 @@ class TreeMetadataEmitter(LoggingMixin):
|
|
|
- ctxt_sources[variable][canonical_suffix] += sorted(srcs)
|
|
|
- yield obj
|
|
|
-
|
|
|
- if ctxt_sources:
|
|
|
- for linkable in linkables:
|
|
|
- for target_var in ('SOURCES', 'UNIFIED_SOURCES'):
|
|
|
- for suffix, srcs in ctxt_sources[target_var].items():
|
|
|
- linkable.sources[suffix] += srcs
|
|
|
-+ if no_pgo_sources:
|
|
|
-+ linkable.no_pgo_sources = no_pgo_sources
|
|
|
-+ elif no_pgo:
|
|
|
-+ linkable.no_pgo = True
|
|
|
- for host_linkable in host_linkables:
|
|
|
- for suffix, srcs in ctxt_sources['HOST_SOURCES'].items():
|
|
|
- host_linkable.sources[suffix] += srcs
|
|
|
-
|
|
|
- for f, flags in all_flags.iteritems():
|
|
|
- if flags.flags:
|
|
|
- ext = mozpath.splitext(f)[1]
|
|
|
- yield PerSourceFlag(context, f, flags.flags)
|