diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 13f8140f1f..b1d797e6fc 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -253,6 +253,13 @@ ifneq ($(filter memtag_heap memtag_stack,$(my_sanitize)),) endif endif +# Ignore SANITIZE_TARGET_DIAG=memtag_heap without SANITIZE_TARGET=memtag_heap +# This can happen if a condition above filters out memtag_heap from +# my_sanitize. It is easier to handle all of these cases here centrally. +ifneq ($(filter memtag_heap,$(my_sanitize_diag)),) + my_sanitize_diag := $(filter-out memtag_heap,$(my_sanitize_diag)) +endif + ifneq ($(filter memtag_heap,$(my_sanitize)),) my_cflags += -fsanitize=memtag-heap my_sanitize := $(filter-out memtag_heap,$(my_sanitize))