Skip to content

Commit

Permalink
Bug 1861291 - Move relrhack manual interdependency to the backend. r=…
Browse files Browse the repository at this point in the history
…firefox-build-system-reviewers,ahochheiden

Differential Revision: https://phabricator.services.mozilla.com/D191924
  • Loading branch information
glandium committed Oct 27, 2023
1 parent c9b509a commit 3f5e73c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 0 additions & 6 deletions config/recurse.mk
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,6 @@ endif

# Interdependencies that moz.build world don't know about yet for compilation.
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
ifdef RELRHACK
# When building with RELR-based ELF hack, we need to build the relevant parts
# before any target.
$(filter %/target,$(compile_targets)): build/unix/elfhack/host build/unix/elfhack/inject/target-objects
endif

ifdef MOZ_USING_WASM_SANDBOXING
security/rlbox/pre-compile media/libsoundtouch/src/pre-compile: config/external/wasm2c_sandbox_compiler/host
dom/media/ogg/target-objects extensions/spellcheck/hunspell/glue/target-objects gfx/thebes/target-objects parser/expat/target-objects parser/htmlparser/target-objects gfx/ots/src/target-objects: security/rlbox/pre-compile
Expand Down
11 changes: 11 additions & 0 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ def consume_object(self, obj):

if isinstance(obj, Linkable):
self._process_test_support_file(obj)
self._process_relrhack(obj)

if isinstance(obj, DirectoryTraversal):
self._process_directory_traversal(obj, backend_file)
Expand Down Expand Up @@ -1237,6 +1238,16 @@ def _process_simple_program(self, obj, backend_file):
def _process_host_simple_program(self, program, backend_file):
backend_file.write("HOST_SIMPLE_PROGRAMS += %s\n" % program)

def _process_relrhack(self, obj):
if isinstance(
obj, (SimpleProgram, Program, SharedLibrary)
) and obj.config.substs.get("RELRHACK"):
# When building with RELR-based ELF hack, we need to build the relevant parts
# before any target.
node = self._compile_graph[self._build_target_for_obj(obj)]
node.add("build/unix/elfhack/host")
node.add("build/unix/elfhack/inject/target-objects")

def _process_test_support_file(self, obj):
# Ensure test support programs and libraries are tracked by an
# install manifest for the benefit of the test packager.
Expand Down

0 comments on commit 3f5e73c

Please sign in to comment.