Add extra cflags to hwasan targets.
Bug: 112438058
Test: SANITIZE_TARGET=hwaddress
Change-Id: I572cb20369b2e98ab5153f665af60366cb7f7657
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 333e825..9ef2570 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -370,6 +370,11 @@
endif
endif
+# If local module needs HWASAN, add compiler flags.
+ifneq ($(filter hwaddress,$(my_sanitize)),)
+ my_cflags += $(HWADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS)
+endif
+
# Use minimal diagnostics when integer overflow is enabled; never do it for HOST or AUX modules
ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_IS_AUX_MODULE),)
# Pre-emptively add UBSAN minimal runtime incase a static library dependency requires it