diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 7882fdf02..ac3e4fc85 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -157,9 +157,13 @@ ifneq ($(filter address,$(my_global_sanitize) $(my_sanitize)),) my_ldflags += -Wl,--as-needed endif - my_linker := $($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_LINKER) - # Make sure linker_asan get installed. - $(LOCAL_INSTALLED_MODULE) : | $(PRODUCT_OUT)$($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_LINKER) + ifeq ($(LOCAL_MODULE_CLASS),EXECUTABLES) + ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) + my_linker := $($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_LINKER) + # Make sure linker_asan get installed. + $(LOCAL_INSTALLED_MODULE) : | $(PRODUCT_OUT)$($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_LINKER) + endif + endif endif endif