From a6311b72120837b07188573bd80ffdf7ee884d73 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 30 Jul 2015 10:17:33 -0700 Subject: [PATCH] Make TSAN easier to use. TSAN is not supported on 32-bit architectures. For non-multilib cases, make its use an error. For multilib cases, don't use it for the 32-bit case. Change-Id: I8e40be4002379cc2c9aa98ab8b812b337d6e077e --- core/config_sanitizers.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index f71996d2b2..41956cbdfa 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -34,6 +34,18 @@ ifeq ($(my_sanitize),never) my_sanitize := endif +# TSAN is not supported on 32-bit architectures. For non-multilib cases, make +# its use an error. For multilib cases, don't use it for the 32-bit case. +ifneq ($(filter thread,$(my_sanitize)),) + ifeq ($(my_32_64_bit_suffix),32) + ifeq ($(my_module_multilib),both) + my_sanitize := $(filter-out thread,$(my_sanitize)) + else + $(error $(LOCAL_PATH): $(LOCAL_MODULE): TSAN cannot be used for 32-bit modules.) + endif + endif +endif + # Undefined symbols can occur if a non-sanitized library links # sanitized static libraries. That's OK, because the executable # always depends on the ASan runtime library, which defines these