Merge "Fix AddressSanitizer link order and multilib setup."
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 6bc3632..1357b39 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -173,6 +173,7 @@
LOCAL_DPI_VARIANTS:=
LOCAL_DPI_FILE_STEM:=
LOCAL_SANITIZE:=
+LOCAL_SANITIZE_RECOVER:=
# arch specific variables
LOCAL_SRC_FILES_$(TARGET_ARCH):=
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 6b0c6c8..e195692 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -90,9 +90,17 @@
endif
ifneq ($(filter undefined,$(my_sanitize)),)
+ my_cflags += -fno-sanitize-recover=all
+
ifdef LOCAL_IS_HOST_MODULE
my_ldlibs += -ldl
else
$(error ubsan is not yet supported on the target)
endif
endif
+
+
+ifeq ($(strip $(LOCAL_SANITIZE_RECOVER)),true)
+ recover_arg := $(subst $(space),$(comma),$(my_sanitize)),
+ my_cflags += -fsanitize-recover=$(recover_arg)
+endif