Merge "Revert "Define vendor-hwasan-snapshot target"" am: 0ffb3e522e

Original change: https://android-review.googlesource.com/c/platform/build/+/2373468

Change-Id: I5512e9e04585d099755686b55412fe4f19006f7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-01-03 17:36:45 +00:00 committed by Automerger Merge Worker
commit c3dbecdc07

View file

@ -27,56 +27,6 @@ vendor-fake-snapshot: $(SOONG_VENDOR_FAKE_SNAPSHOT_ZIP)
$(call dist-for-goals, vendor-fake-snapshot, $(SOONG_VENDOR_FAKE_SNAPSHOT_ZIP):fake/$(notdir $(SOONG_VENDOR_FAKE_SNAPSHOT_ZIP))) $(call dist-for-goals, vendor-fake-snapshot, $(SOONG_VENDOR_FAKE_SNAPSHOT_ZIP):fake/$(notdir $(SOONG_VENDOR_FAKE_SNAPSHOT_ZIP)))
# Capture prebuilt vendor static libraries of hwasan variant.
# To build the hwasan variant `SANITIZE_TARGET=hwaddress` must be set.
# vendor-hwasan-snapshot goal zips hwasan static libs listed in
# PRODUCT_VSDK_HWASAN_STATIC_PATHS which has a list of pairs of
# 'module name':'source directory path'
ifeq ($(SANITIZE_TARGET),hwaddress)
vsdk_hwasan_static_zip := $(PRODUCT_OUT)/vsdk-hwasan-snapshot.zip
vsdk_hwasan_static_dir := $(PRODUCT_OUT)/vsdk-hwasan-snapshot
vsdk_hwasan_variants := \
android \
vendor.$(PLATFORM_VNDK_VERSION) \
$(TARGET_ARCH) \
$(TARGET_ARCH_VARIANT) \
$(TARGET_CPU_VARIANT) \
static \
hwasan
vsdk_hwasan_variant_name := $(subst _generic_,_,$(subst $(space),_,$(vsdk_hwasan_variants)))
define get_vendor_hwasan_static_path
$(SOONG_OUT_DIR)/.intermediates/$(call word-colon,2,$(1))/$(call word-colon,1,$(1))/$(vsdk_hwasan_variant_name)/$(call word-colon,1,$(1)).a
endef
$(vsdk_hwasan_static_zip): PRIVATE_MAKEFILE := $(current_makefile)
$(vsdk_hwasan_static_zip): PRIVATE_HWASAN_DIR := $(vsdk_hwasan_static_dir)
$(vsdk_hwasan_static_zip): $(SOONG_ZIP) $(foreach p, $(PRODUCT_VSDK_HWASAN_STATIC_PATHS), $(call get_vendor_hwasan_static_path,$(p)))
$(if $(PRODUCT_VSDK_HWASAN_STATIC_PATHS),,\
$(call echo-error,$(PRIVATE_MAKEFILE),\
"CANNOT generate Vendor HWASAN snapshot. PRODUCT_VSDK_HWASAN_STATIC_PATHS is not defined.") &&\
exit 1)
@rm -rf $(PRIVATE_HWASAN_DIR)
@mkdir -p $(PRIVATE_HWASAN_DIR)
$(foreach p, $(PRODUCT_VSDK_HWASAN_STATIC_PATHS), \
cp -f $(call get_vendor_hwasan_static_path,$(p)) $(PRIVATE_HWASAN_DIR) &&) true
$(SOONG_ZIP) -o $@ -C $(PRIVATE_HWASAN_DIR) -D $(PRIVATE_HWASAN_DIR)
.PHONY: vendor-hwasan-snapshot
vendor-hwasan-snapshot: $(vsdk_hwasan_static_zip)
$(call dist-for-goals, vendor-hwasan-snapshot, $(vsdk_hwasan_static_zip))
else # Not for the HWASAN build
.PHONY: vendor-hwasan-snapshot
vendor-hwasan-snapshot: PRIVATE_MAKEFILE := $(current_makefile)
vendor-hwasan-snapshot:
$(call echo-error,$(PRIVATE_MAKEFILE),\
"CANNOT generate Vendor HWASAN snapshot. SANITIZE_TARGET must be set to 'hwaddress'.")
exit 1
endif # SANITIZE_TARGET
else # BOARD_VNDK_VERSION is NOT set to 'current' else # BOARD_VNDK_VERSION is NOT set to 'current'
.PHONY: vendor-snapshot .PHONY: vendor-snapshot
@ -93,11 +43,4 @@ vendor-fake-snapshot:
"CANNOT generate Vendor snapshot. BOARD_VNDK_VERSION must be set to 'current'.") "CANNOT generate Vendor snapshot. BOARD_VNDK_VERSION must be set to 'current'.")
exit 1 exit 1
.PHONY: vendor-hwasan-snapshot
vendor-hwasan-snapshot: PRIVATE_MAKEFILE := $(current_makefile)
vendor-hwasan-snapshot:
$(call echo-error,$(PRIVATE_MAKEFILE),\
"CANNOT generate Vendor HWASAN snapshot. BOARD_VNDK_VERSION must be set to 'current'.")
exit 1
endif # BOARD_VNDK_VERSION endif # BOARD_VNDK_VERSION