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
This commit is contained in:
Colin Cross 2019-09-05 14:27:02 -07:00
parent fdef43d69c
commit 70bfe07e6c
2 changed files with 15 additions and 2 deletions

View File

@ -115,6 +115,7 @@ LOCAL_HEADER_LIBRARIES:=
LOCAL_HOST_PREFIX:=
LOCAL_HOST_REQUIRED_MODULES:=
LOCAL_INIT_RC:=
LOCAL_INJECT_BSSL_HASH:=
LOCAL_INSTALLED_MODULE:=
LOCAL_INSTALLED_MODULE_STEM:=
LOCAL_INSTRUMENTATION_FOR:=

View File

@ -39,6 +39,17 @@ include $(BUILD_SYSTEM)/use_lld_setup.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
###########################################################
@ -47,7 +58,7 @@ my_unstripped_path := $(TARGET_OUT_UNSTRIPPED)/$(patsubst $(PRODUCT_OUT)/%,%,$(m
else
my_unstripped_path := $(LOCAL_UNSTRIPPED_PATH)
endif
symbolic_input := $(linked_module)
symbolic_input := $(inject_module)
symbolic_output := $(my_unstripped_path)/$(my_installed_module_stem)
$(symbolic_output) : $(symbolic_input)
@echo "target Symbolic: $(PRIVATE_MODULE) ($@)"
@ -59,7 +70,7 @@ $(symbolic_output) : $(symbolic_input)
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
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) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) $(PRIVATE_READELF)
@echo "target breakpad: $(PRIVATE_MODULE) ($@)"
@ -133,6 +144,7 @@ endif # my_strip_module
$(cleantarget): PRIVATE_CLEAN_FILES += \
$(linked_module) \
$(inject_module) \
$(breakpad_output) \
$(symbolic_output) \
$(strip_output)