From f46bc5add9c8cefbd11d9edf445d86e231a4ea49 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Mon, 15 Apr 2024 15:17:19 +0800 Subject: [PATCH 1/2] Define a make target for all APEX dumps The SDK finalization process will create APEX ABI dumps from this target. Test: make findlsdumps_APEX Bug: 333532038 Change-Id: Iaec03bd39923678141b12436e5a6b8576e63a999 --- target/product/gsi/Android.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk index fc6cc68439..432fcd7038 100644 --- a/target/product/gsi/Android.mk +++ b/target/product/gsi/Android.mk @@ -34,6 +34,9 @@ $(patsubst $(tag_patterns),%,$(filter $(tag_patterns),$(2))) endef # Subsets of LSDUMP_PATHS. +.PHONY: findlsdumps_APEX +findlsdumps_APEX: $(LSDUMP_PATHS_FILE) $(call filter-abi-dump-paths,APEX,$(LSDUMP_PATHS)) + .PHONY: findlsdumps_LLNDK findlsdumps_LLNDK: $(LSDUMP_PATHS_FILE) $(call filter-abi-dump-paths,LLNDK,$(LSDUMP_PATHS)) @@ -48,7 +51,7 @@ findlsdumps: $(LSDUMP_PATHS_FILE) $(foreach p,$(LSDUMP_PATHS),$(call word-colon, ##################################################################### # Check that all ABI reference dumps have corresponding -# NDK/VNDK/PLATFORM libraries. +# APEX/LLNDK/PLATFORM libraries. # $(1): The directory containing ABI dumps. # Return a list of ABI dump paths ending with .so.lsdump. @@ -90,7 +93,7 @@ $(check-abi-dump-list-timestamp): # TODO(b/314010764): Remove LLNDK tag after PLATFORM_SDK_VERSION is upgraded to 35. $(eval added_platform_abi_dumps := $(strip $(sort $(filter-out \ - $(call filter-abi-dump-names,LLNDK PLATFORM,$(PRIVATE_LSDUMP_PATHS)) \ + $(call filter-abi-dump-names,APEX LLNDK PLATFORM,$(PRIVATE_LSDUMP_PATHS)) \ $(addsuffix .lsdump,$(PRIVATE_STUB_LIBRARIES)), \ $(notdir $(PLATFORM_ABI_DUMPS)))))) $(if $(added_platform_abi_dumps), \ From c851627d330a6ec330b522bf61e0742947ec0856 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Wed, 17 Apr 2024 12:57:05 +0800 Subject: [PATCH 2/2] Fix check-abi-dump-list - Fix the timestamp variable name. - Convert the intermediate file name extensions to those in the prebuilt directory. - Disable check-abi-dump-list for sanitizer and coverage builds. - Add an exception for libRS, RISC-V. Test: m check-abi-dump-list Bug: 333532038 Change-Id: I35b644feed1bef1e6c74731e8f69074bdc5b0352 --- target/product/gsi/Android.mk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk index 432fcd7038..36897fef8e 100644 --- a/target/product/gsi/Android.mk +++ b/target/product/gsi/Android.mk @@ -8,11 +8,14 @@ LOCAL_PATH:= $(call my-dir) # Check if vndk list is changed droidcore: check-abi-dump-list -check-vndk-abi-dump-list-timestamp := $(call intermediates-dir-for,PACKAGING,vndk)/check-abi-dump-list-timestamp +check-abi-dump-list-timestamp := $(call intermediates-dir-for,PACKAGING,vndk)/check-abi-dump-list-timestamp -ifneq ($(SKIP_ABI_CHECKS),true) +# The ABI tool does not support sanitizer and coverage builds. +ifeq (,$(filter true,$(SKIP_ABI_CHECKS) $(CLANG_COVERAGE))) +ifeq (,$(SANITIZE_TARGET)) check-abi-dump-list: $(check-abi-dump-list-timestamp) endif +endif ##################################################################### # ABI reference dumps. @@ -63,9 +66,12 @@ endef # $(1): A list of tags. # $(2): A list of tag:path. -# Return the file names of the ABI dumps that match the tags. +# Return the file names of the ABI dumps that match the tags, and replace the +# file name extensions with .so.lsdump. define filter-abi-dump-names -$(notdir $(call filter-abi-dump-paths,$(1),$(2))) +$(patsubst %.so.llndk.lsdump,%.so.lsdump, \ + $(patsubst %.so.apex.lsdump,%.so.lsdump, \ + $(notdir $(call filter-abi-dump-paths,$(1),$(2))))) endef VNDK_ABI_DUMP_DIR := prebuilts/abi-dumps/vndk/$(RELEASE_BOARD_API_LEVEL) @@ -80,13 +86,14 @@ PLATFORM_ABI_DUMPS := $(call find-abi-dump-paths,$(PLATFORM_ABI_DUMP_DIR)) # Check for superfluous lsdump files. Since LSDUMP_PATHS only covers the # libraries that can be built from source in the current build, and prebuilts of # Mainline modules may be in use, we also allow the libs in STUB_LIBRARIES for -# NDK and platform ABIs. +# platform ABIs. +# In addition, libRS is allowed because it's disabled for RISC-V. $(check-abi-dump-list-timestamp): PRIVATE_LSDUMP_PATHS := $(LSDUMP_PATHS) $(check-abi-dump-list-timestamp): PRIVATE_STUB_LIBRARIES := $(STUB_LIBRARIES) $(check-abi-dump-list-timestamp): $(eval added_vndk_abi_dumps := $(strip $(sort $(filter-out \ - $(call filter-abi-dump-names,LLNDK,$(PRIVATE_LSDUMP_PATHS)), \ + $(call filter-abi-dump-names,LLNDK,$(PRIVATE_LSDUMP_PATHS)) libRS.so.lsdump, \ $(notdir $(VNDK_ABI_DUMPS)))))) $(if $(added_vndk_abi_dumps), \ echo -e "Found unexpected ABI reference dump files under $(VNDK_ABI_DUMP_DIR). It is caused by mismatch between Android.bp and the dump files. Run \`find \$${ANDROID_BUILD_TOP}/$(VNDK_ABI_DUMP_DIR) '(' -name $(subst $(space), -or -name ,$(added_vndk_abi_dumps)) ')' -delete\` to delete the dump files.") @@ -94,7 +101,7 @@ $(check-abi-dump-list-timestamp): # TODO(b/314010764): Remove LLNDK tag after PLATFORM_SDK_VERSION is upgraded to 35. $(eval added_platform_abi_dumps := $(strip $(sort $(filter-out \ $(call filter-abi-dump-names,APEX LLNDK PLATFORM,$(PRIVATE_LSDUMP_PATHS)) \ - $(addsuffix .lsdump,$(PRIVATE_STUB_LIBRARIES)), \ + $(addsuffix .lsdump,$(PRIVATE_STUB_LIBRARIES)) libRS.so.lsdump, \ $(notdir $(PLATFORM_ABI_DUMPS)))))) $(if $(added_platform_abi_dumps), \ echo -e "Found unexpected ABI reference dump files under $(PLATFORM_ABI_DUMP_DIR). It is caused by mismatch between Android.bp and the dump files. Run \`find \$${ANDROID_BUILD_TOP}/$(PLATFORM_ABI_DUMP_DIR) '(' -name $(subst $(space), -or -name ,$(added_platform_abi_dumps)) ')' -delete\` to delete the dump files.")