Merge "Fix evaluation order of (Cfi|Memtag) exclude paths." am: 99802c7544

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

Change-Id: I3ad28fa43e01fb17a5c405b2513a57b479d03ffa
This commit is contained in:
Treehugger Robot
2021-04-15 04:42:26 +00:00
committed by Automerger Merge Worker

View File

@@ -120,12 +120,17 @@ ifeq ($(filter cfi, $(my_sanitize)),)
ifneq ($(filter arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
combined_include_paths := $(CFI_INCLUDE_PATHS) \
$(PRODUCT_CFI_INCLUDE_PATHS)
combined_exclude_paths := $(CFI_EXCLUDE_PATHS) \
$(PRODUCT_CFI_EXCLUDE_PATHS)
ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_include_paths)),\
$(filter $(dir)%,$(LOCAL_PATH)))),)
ifeq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_exclude_paths)),\
$(filter $(dir)%,$(LOCAL_PATH)))),)
my_sanitize := cfi $(my_sanitize)
endif
endif
endif
endif
# Enable memtag_heap in included paths (for Arm64 only).
@@ -135,7 +140,11 @@ ifeq ($(filter memtag_heap, $(my_sanitize)),)
$(PRODUCT_MEMTAG_HEAP_SYNC_INCLUDE_PATHS)
combined_async_include_paths := $(MEMTAG_HEAP_ASYNC_INCLUDE_PATHS) \
$(PRODUCT_MEMTAG_HEAP_ASYNC_INCLUDE_PATHS)
combined_exclude_paths := $(MEMTAG_HEAP_EXCLUDE_PATHS) \
$(PRODUCT_MEMTAG_HEAP_EXCLUDE_PATHS)
ifeq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_exclude_paths)),\
$(filter $(dir)%,$(LOCAL_PATH)))),)
ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_sync_include_paths)),\
$(filter $(dir)%,$(LOCAL_PATH)))),)
my_sanitize := memtag_heap $(my_sanitize)
@@ -145,6 +154,7 @@ ifeq ($(filter memtag_heap, $(my_sanitize)),)
my_sanitize := memtag_heap $(my_sanitize)
endif
endif
endif
endif
# If CFI is disabled globally, remove it from my_sanitize.