From 2a880756174b8fc300af9020485c24cd9db553c5 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Tue, 17 Sep 2019 09:45:09 -0700 Subject: [PATCH] Always check ELF files for `check-elf-files` With this commit, the build system always checks ELF files when `check-elf-files` is one of the make goals regardless `PRODUCT_CHECK_ELF_FILES` is specified or not. This commit also adds `BUILD_BROKEN_PREBUILT_ELF_FILES` for targets that haven't been cleared. If this commit breaks your target (usually breaks the targets running `make checkbuild`), you may triage the breakage by adding the following setting to your `BoardConfig.mk`: BUILD_BROKEN_PREBUILT_ELF_FILES := true Bug: 141176116 Test: lunch aosp_crosshatch-userdebug && make check-elf-files Change-Id: Ibe65c977a4ab3d40ba35892ed177eca62c837c35 --- core/board_config.mk | 1 + core/check_elf_file.mk | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/board_config.mk b/core/board_config.mk index a6aef87e9..5370b5e75 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -86,6 +86,7 @@ _board_strip_readonly_list += $(_dynamic_partitions_var_list) _build_broken_var_list := \ BUILD_BROKEN_DUP_RULES \ + BUILD_BROKEN_PREBUILT_ELF_FILES \ BUILD_BROKEN_USES_NETWORK \ _build_broken_var_list += \ diff --git a/core/check_elf_file.mk b/core/check_elf_file.mk index 0faaadd3f..7a5de6769 100644 --- a/core/check_elf_file.mk +++ b/core/check_elf_file.mk @@ -38,12 +38,18 @@ $(check_elf_files_stamp): $(my_prebuilt_src_file) $(my_check_elf_file_shared_lib $< $(hide) touch $@ -ifneq ($(PRODUCT_CHECK_ELF_FILES)$(CHECK_ELF_FILES),) ifneq ($(strip $(LOCAL_CHECK_ELF_FILES)),false) +ifneq ($(strip $(BUILD_BROKEN_PREBUILT_ELF_FILES)),true) +# TODO(b/141176116): Remove the PRODUCT_CHECK_ELF_FILES condition below and +# cover `make droid` targets after everything goes well with `make checkbuild` +# targets. +ifneq ($(PRODUCT_CHECK_ELF_FILES)$(CHECK_ELF_FILES),) $(LOCAL_BUILT_MODULE): $(check_elf_files_stamp) -check-elf-files: $(check_elf_files_stamp) -endif # LOCAL_CHECK_ELF_FILES endif # PRODUCT_CHECK_ELF_FILES or CHECK_ELF_FILES +check-elf-files: $(check_elf_files_stamp) +endif # BUILD_BROKEN_PREBUILT_ELF_FILES +endif # LOCAL_CHECK_ELF_FILES + endif # SHARED_LIBRARIES, EXECUTABLES, NATIVE_TESTS endif # !LOCAL_IS_HOST_MODULE