Merge "Fix check_elf_file with LOCAL_SDK_VERSION and NDK libs"

am: ab28c2d4ef

Change-Id: I90ef9805a09710c9ced9775f4aab2a3b869a83aa
This commit is contained in:
Logan Chien 2019-03-19 02:22:25 -07:00 committed by android-build-merger
commit 9e7d8b77a4
2 changed files with 14 additions and 2 deletions

View file

@ -13,14 +13,18 @@
# - intermediates
# - my_installed_module_stem
# - my_prebuilt_src_file
# - my_check_elf_file_shared_lib_files
ifndef LOCAL_IS_HOST_MODULE
ifneq ($(filter $(LOCAL_MODULE_CLASS),SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS),)
check_elf_files_stamp := $(intermediates)/check_elf_files.timestamp
$(check_elf_files_stamp): PRIVATE_SONAME := $(if $(filter $(LOCAL_MODULE_CLASS),SHARED_LIBRARIES),$(my_installed_module_stem))
$(check_elf_files_stamp): PRIVATE_ALLOW_UNDEFINED_SYMBOLS := $(LOCAL_ALLOW_UNDEFINED_SYMBOLS)
$(check_elf_files_stamp): PRIVATE_SHARED_LIBRARY_FILES := # This variable will be set by `core/main.mk`
$(check_elf_files_stamp): $(my_prebuilt_src_file) $(CHECK_ELF_FILE) $(LLVM_READOBJ)
# PRIVATE_SHARED_LIBRARY_FILES are file paths to built shared libraries.
# In addition to $(my_check_elf_file_shared_lib_files), some file paths are
# added by `resolve-shared-libs-for-elf-file-check` from `core/main.mk`.
$(check_elf_files_stamp): PRIVATE_SHARED_LIBRARY_FILES := $(my_check_elf_file_shared_lib_files)
$(check_elf_files_stamp): $(my_prebuilt_src_file) $(my_check_elf_file_shared_lib_files) $(CHECK_ELF_FILE) $(LLVM_READOBJ)
@echo Check prebuilt ELF binary: $<
$(hide) mkdir -p $(dir $@)
$(hide) rm -f $@

View file

@ -108,6 +108,8 @@ $(error $(LOCAL_MODULE) : LOCAL_COMPRESSED_MODULE can only be defined for module
endif # LOCAL_COMPRESSED_MODULE
endif
my_check_elf_file_shared_lib_files :=
ifneq ($(filter true keep_symbols no_debuglink mini-debug-info,$(my_strip_module)),)
ifdef LOCAL_IS_HOST_MODULE
$(call pretty-error,Cannot strip/pack host module)
@ -123,6 +125,12 @@ ifneq ($(filter true keep_symbols no_debuglink mini-debug-info,$(my_strip_module
include $(BUILD_SYSTEM)/dynamic_binary.mk
built_module := $(linked_module)
ifneq ($(LOCAL_SDK_VERSION),)
# binary.mk filters out NDK_MIGRATED_LIBS from my_shared_libs, thus those NDK libs are not added
# to DEPENDENCIES_ON_SHARED_LIBRARIES. Assign $(my_ndk_shared_libraries_fullpath) to
# my_check_elf_file_shared_lib_files so that check_elf_file.py can see those NDK stub libs.
my_check_elf_file_shared_lib_files := $(my_ndk_shared_libraries_fullpath)
endif
else # my_strip_module not true
include $(BUILD_SYSTEM)/base_rules.mk
built_module := $(LOCAL_BUILT_MODULE)