From d4dbf7921de920266b1d0e35a1d4a41198f5cf04 Mon Sep 17 00:00:00 2001 From: Vishwath Mohan Date: Tue, 16 May 2017 14:27:34 -0700 Subject: Always use non-sanitized library locations for JNI. This CL changes the build system to always look for shared JNI libraries at their unsanitized install locations. Bug: 38309771 Test: m -j40 && SANITIZE_TARGET="address" m -j40 Change-Id: Icb9d4f5365def6ea7a780553f455f41d2cb8b8bf --- core/envsetup.mk | 6 ++++++ core/install_jni_libs_internal.mk | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/envsetup.mk b/core/envsetup.mk index ba9d7ebf3b..a734cc751e 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -187,6 +187,12 @@ TARGET_COPY_OUT_OEM := oem TARGET_COPY_OUT_ODM := odm TARGET_COPY_OUT_ROOT := root TARGET_COPY_OUT_RECOVERY := recovery + +# Returns the non-sanitized version of the path provided in $1. +define get_non_asan_path +$(patsubst $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/%,$(PRODUCT_OUT)/%,$1) +endef + ########################################### # Define TARGET_COPY_OUT_VENDOR to a placeholder, for at this point # we don't know if the device wants to build a separate vendor.img diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk index 3898dc90f4..0e92153663 100644 --- a/core/install_jni_libs_internal.mk +++ b/core/install_jni_libs_internal.mk @@ -54,7 +54,8 @@ ifneq ($(my_jni_shared_libraries),) # The jni libaries will be installed to the system.img. my_jni_filenames := $(notdir $(my_jni_shared_libraries)) # Make sure the JNI libraries get installed -my_shared_library_path := $($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES) +my_shared_library_path := $(call get_non_asan_path,\ + $($(my_2nd_arch_prefix)TARGET_OUT$(partition_tag)_SHARED_LIBRARIES)) # Do not use order-only dependency, because we want to rebuild the image if an jni is updated. $(LOCAL_INSTALLED_MODULE) : $(addprefix $(my_shared_library_path)/, $(my_jni_filenames)) -- cgit v1.2.3