From 8b80f3e4d5316cd86b8f07b03a1b24ff4d01a424 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Mon, 12 Apr 2021 11:46:17 -0700 Subject: [PATCH] Only link the MTE notes against executables. Soong has equivalent logic but it was missing on the .mk side. Bug: 135772972 Change-Id: I5fc5a387313f6ae43c6510ee63d153aa81fb58b1 --- core/config_sanitizers.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 228bad682b..e0b8fdeea5 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -211,10 +211,12 @@ 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 + ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) + 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 endif # This is all that memtag_heap does - it is not an actual -fsanitize argument. # Remove it from the list.