From fe35441af558da24e093fc9d80bcb20f360195d5 Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Wed, 19 May 2021 11:29:02 -0700 Subject: [PATCH] [memtag] Disable memtag for AndroidMk host modules. BUILD_HOST_EXECUTABLE modules are substantially deprecated, but some partners are still using them for their bits with the workaround provided in the product definition. This fixes a build error where the host module doesn't have a linkable ELF note archive. MTE is not intended for host modules, and it's fine for us to say "host module using AndroidMk - no MTE for you" if this changes. Bug: 189330992 Test: Manually tested using a BUILD_HOST_EXECUTABLE module. Change-Id: Ifedff39f2f03c08bfb644221d2ab1b88e635c8a3 Merged-In: Ifedff39f2f03c08bfb644221d2ab1b88e635c8a3 --- core/config_sanitizers.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 90f00c0e0..46f7f2477 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -167,6 +167,13 @@ ifneq ($(filter address,$(my_sanitize)),) my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag)) endif +# Disable memtag for host targets. Host executables in AndroidMk files are +# deprecated, but some partners still have them floating around. +ifdef LOCAL_IS_HOST_MODULE + my_sanitize := $(filter-out memtag_heap,$(my_sanitize)) + my_sanitize_diag := $(filter-out memtag_heap,$(my_sanitize_diag)) +endif + # Disable sanitizers which need the UBSan runtime for host targets. ifdef LOCAL_IS_HOST_MODULE my_sanitize := $(filter-out cfi,$(my_sanitize))