Merge "Support memtag_heap sanitizer type in make."
This commit is contained in:
commit
d0bd7f0db6
1 changed files with 46 additions and 0 deletions
|
@ -53,6 +53,18 @@ ifneq ($(filter cfi, $(my_global_sanitize)),)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Disable global memtag_heap in excluded paths
|
||||||
|
ifneq ($(filter memtag_heap, $(my_global_sanitize)),)
|
||||||
|
combined_exclude_paths := $(MEMTAG_HEAP_EXCLUDE_PATHS) \
|
||||||
|
$(PRODUCT_MEMTAG_HEAP_EXCLUDE_PATHS)
|
||||||
|
|
||||||
|
ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_exclude_paths)),\
|
||||||
|
$(filter $(dir)%,$(LOCAL_PATH)))),)
|
||||||
|
my_global_sanitize := $(filter-out memtag_heap,$(my_global_sanitize))
|
||||||
|
my_global_sanitize_diag := $(filter-out memtag_heap,$(my_global_sanitize_diag))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(my_global_sanitize),)
|
ifneq ($(my_global_sanitize),)
|
||||||
my_sanitize := $(my_global_sanitize) $(my_sanitize)
|
my_sanitize := $(my_global_sanitize) $(my_sanitize)
|
||||||
endif
|
endif
|
||||||
|
@ -116,6 +128,25 @@ ifeq ($(filter cfi, $(my_sanitize)),)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Enable memtag_heap in included paths (for Arm64 only).
|
||||||
|
ifeq ($(filter memtag_heap, $(my_sanitize)),)
|
||||||
|
ifneq ($(filter arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
|
||||||
|
combined_sync_include_paths := $(MEMTAG_HEAP_SYNC_INCLUDE_PATHS) \
|
||||||
|
$(PRODUCT_MEMTAG_HEAP_SYNC_INCLUDE_PATHS)
|
||||||
|
combined_async_include_paths := $(MEMTAG_HEAP_ASYNC_INCLUDE_PATHS) \
|
||||||
|
$(PRODUCT_MEMTAG_HEAP_ASYNC_INCLUDE_PATHS)
|
||||||
|
|
||||||
|
ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_sync_include_paths)),\
|
||||||
|
$(filter $(dir)%,$(LOCAL_PATH)))),)
|
||||||
|
my_sanitize := memtag_heap $(my_sanitize)
|
||||||
|
my_sanitize_diag := memtag_heap $(my_sanitize)
|
||||||
|
else ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_async_include_paths)),\
|
||||||
|
$(filter $(dir)%,$(LOCAL_PATH)))),)
|
||||||
|
my_sanitize := memtag_heap $(my_sanitize)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# If CFI is disabled globally, remove it from my_sanitize.
|
# If CFI is disabled globally, remove it from my_sanitize.
|
||||||
ifeq ($(strip $(ENABLE_CFI)),false)
|
ifeq ($(strip $(ENABLE_CFI)),false)
|
||||||
my_sanitize := $(filter-out cfi,$(my_sanitize))
|
my_sanitize := $(filter-out cfi,$(my_sanitize))
|
||||||
|
@ -164,6 +195,7 @@ endif
|
||||||
|
|
||||||
ifneq ($(filter arm x86 x86_64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
|
ifneq ($(filter arm x86 x86_64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
|
||||||
my_sanitize := $(filter-out hwaddress,$(my_sanitize))
|
my_sanitize := $(filter-out hwaddress,$(my_sanitize))
|
||||||
|
my_sanitize := $(filter-out memtag_heap,$(my_sanitize))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter hwaddress,$(my_sanitize)),)
|
ifneq ($(filter hwaddress,$(my_sanitize)),)
|
||||||
|
@ -183,6 +215,20 @@ ifneq ($(filter hwaddress,$(my_sanitize)),)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter memtag_heap,$(my_sanitize)),)
|
||||||
|
# Add memtag ELF note.
|
||||||
|
ifneq ($(filter memtag_heap,$(my_sanitize_diag)),)
|
||||||
|
my_whole_static_libraries += note_memtag_heap_sync
|
||||||
|
else
|
||||||
|
my_whole_static_libraries += note_memtag_heap_async
|
||||||
|
endif
|
||||||
|
# This is all that memtag_heap does - it is not an actual -fsanitize argument.
|
||||||
|
# Remove it from the list.
|
||||||
|
my_sanitize := $(filter-out memtag_heap,$(my_sanitize))
|
||||||
|
endif
|
||||||
|
|
||||||
|
my_sanitize_diag := $(filter-out memtag_heap,$(my_sanitize_diag))
|
||||||
|
|
||||||
# TSAN is not supported on 32-bit architectures. For non-multilib cases, make
|
# TSAN is not supported on 32-bit architectures. For non-multilib cases, make
|
||||||
# its use an error. For multilib cases, don't use it for the 32-bit case.
|
# its use an error. For multilib cases, don't use it for the 32-bit case.
|
||||||
ifneq ($(filter thread,$(my_sanitize)),)
|
ifneq ($(filter thread,$(my_sanitize)),)
|
||||||
|
|
Loading…
Reference in a new issue