Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70bfe07e authored by Colin Cross's avatar Colin Cross
Browse files

Support injecting boringssl hash in Make

Add LOCAL_INJECT_BSSL_HASH for the two modules in Make that
statically link libcrypto.

Bug: 137267623
Test: m checkbuild
Change-Id: I5d21c262ff388aeb2dbd02595706c5531a628b7e
parent fdef43d6
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -115,6 +115,7 @@ LOCAL_HEADER_LIBRARIES:=
LOCAL_HOST_PREFIX:=
LOCAL_HOST_PREFIX:=
LOCAL_HOST_REQUIRED_MODULES:=
LOCAL_HOST_REQUIRED_MODULES:=
LOCAL_INIT_RC:=
LOCAL_INIT_RC:=
LOCAL_INJECT_BSSL_HASH:=
LOCAL_INSTALLED_MODULE:=
LOCAL_INSTALLED_MODULE:=
LOCAL_INSTALLED_MODULE_STEM:=
LOCAL_INSTALLED_MODULE_STEM:=
LOCAL_INSTRUMENTATION_FOR:=
LOCAL_INSTRUMENTATION_FOR:=
+14 −2
Original line number Original line Diff line number Diff line
@@ -39,6 +39,17 @@ include $(BUILD_SYSTEM)/use_lld_setup.mk
include $(BUILD_SYSTEM)/binary.mk
include $(BUILD_SYSTEM)/binary.mk
###################################
###################################


ifdef LOCAL_INJECT_BSSL_HASH
inject_module := $(intermediates)/INJECT_BSSL_HASH/$(notdir $(my_installed_module_stem))
LOCAL_INTERMEDIATE_TARGETS += $(inject_module)
$(inject_module): $(SOONG_HOST_OUT)/bin/bssl_inject_hash
$(inject_module): $(linked_module)
	@echo "target inject BSSL hash: $(PRIVATE_MODULE) ($@)"
	$(SOONG_HOST_OUT)/bin/bssl_inject_hash -in-object $< -o $@
else
inject_module := $(linked_module)
endif

###########################################################
###########################################################
## Store a copy with symbols for symbolic debugging
## Store a copy with symbols for symbolic debugging
###########################################################
###########################################################
@@ -47,7 +58,7 @@ my_unstripped_path := $(TARGET_OUT_UNSTRIPPED)/$(patsubst $(PRODUCT_OUT)/%,%,$(m
else
else
my_unstripped_path := $(LOCAL_UNSTRIPPED_PATH)
my_unstripped_path := $(LOCAL_UNSTRIPPED_PATH)
endif
endif
symbolic_input := $(linked_module)
symbolic_input := $(inject_module)
symbolic_output := $(my_unstripped_path)/$(my_installed_module_stem)
symbolic_output := $(my_unstripped_path)/$(my_installed_module_stem)
$(symbolic_output) : $(symbolic_input)
$(symbolic_output) : $(symbolic_input)
	@echo "target Symbolic: $(PRIVATE_MODULE) ($@)"
	@echo "target Symbolic: $(PRIVATE_MODULE) ($@)"
@@ -59,7 +70,7 @@ $(symbolic_output) : $(symbolic_input)


ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
my_breakpad_path := $(TARGET_OUT_BREAKPAD)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path))
my_breakpad_path := $(TARGET_OUT_BREAKPAD)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path))
breakpad_input := $(linked_module)
breakpad_input := $(inject_module)
breakpad_output := $(my_breakpad_path)/$(my_installed_module_stem).sym
breakpad_output := $(my_breakpad_path)/$(my_installed_module_stem).sym
$(breakpad_output) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) $(PRIVATE_READELF)
$(breakpad_output) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) $(PRIVATE_READELF)
	@echo "target breakpad: $(PRIVATE_MODULE) ($@)"
	@echo "target breakpad: $(PRIVATE_MODULE) ($@)"
@@ -133,6 +144,7 @@ endif # my_strip_module


$(cleantarget): PRIVATE_CLEAN_FILES += \
$(cleantarget): PRIVATE_CLEAN_FILES += \
    $(linked_module) \
    $(linked_module) \
    $(inject_module) \
    $(breakpad_output) \
    $(breakpad_output) \
    $(symbolic_output) \
    $(symbolic_output) \
    $(strip_output)
    $(strip_output)