Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32f54ff7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

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

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

Change-Id: I3ad28fa43e01fb17a5c405b2513a57b479d03ffa
parents 49cd9fb8 99802c75
Loading
Loading
Loading
Loading
+19 −9
Original line number Diff line number Diff line
@@ -120,13 +120,18 @@ 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).
ifeq ($(filter memtag_heap, $(my_sanitize)),)
@@ -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)
@@ -146,6 +155,7 @@ ifeq ($(filter memtag_heap, $(my_sanitize)),)
      endif
    endif
  endif
endif

# If CFI is disabled globally, remove it from my_sanitize.
ifeq ($(strip $(ENABLE_CFI)),false)