Merge "Add missing linker flags for memtag sanitizers." into main am: f6109a1842
Original change: https://android-review.googlesource.com/c/platform/build/+/2945005
Change-Id: I24376ff3f6cdee586e09a0e9ff7eb00988f5ba54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 3507961..ab2d5c1 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -261,10 +261,10 @@
ifneq ($(filter memtag_heap memtag_stack memtag_globals,$(my_sanitize)),)
ifneq ($(filter memtag_heap,$(my_sanitize_diag)),)
- my_cflags += -fsanitize-memtag-mode=sync
+ my_ldflags += -fsanitize-memtag-mode=sync
my_sanitize_diag := $(filter-out memtag_heap,$(my_sanitize_diag))
else
- my_cflags += -fsanitize-memtag-mode=async
+ my_ldflags += -fsanitize-memtag-mode=async
endif
endif
@@ -277,11 +277,13 @@
ifneq ($(filter memtag_heap,$(my_sanitize)),)
my_cflags += -fsanitize=memtag-heap
+ my_ldflags += -fsanitize=memtag-heap
my_sanitize := $(filter-out memtag_heap,$(my_sanitize))
endif
ifneq ($(filter memtag_stack,$(my_sanitize)),)
my_cflags += -fsanitize=memtag-stack
+ my_ldflags += -fsanitize=memtag-stack
my_cflags += -march=armv8a+memtag
my_ldflags += -march=armv8a+memtag
my_asflags += -march=armv8a+memtag
@@ -290,6 +292,7 @@
ifneq ($(filter memtag_globals,$(my_sanitize)),)
my_cflags += -fsanitize=memtag-globals
+ my_ldflags += -fsanitize=memtag-globals
# TODO(mitchp): For now, enable memtag-heap with memtag-globals because the
# linker isn't new enough
# (https://reviews.llvm.org/differential/changeset/?ref=4243566).